comparison pyink/MBScene.py @ 1177:ec1ea8555911

Stop selectSceneObject() from using private variable _keys of frameline
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 31 Dec 2010 10:29:21 +0800
parents 0c1ceecb8ddb
children 416e41952b76
comparison
equal deleted inserted replaced
1176:0c1ceecb8ddb 1177:ec1ea8555911
658 pass 658 pass
659 pass 659 pass
660 pass 660 pass
661 pass 661 pass
662 662
663 def selectSceneObject(self,frameline, nth): 663 def selectSceneObject(self, frameline, nth):
664 i = 0 664 try:
665 while i < len(frameline._keys): 665 start, stop, tween_type = frameline.get_frame_block(nth - 1)
666 s = frameline._keys[i] 666 except:
667 if s.right_tween is False: 667 return
668 if nth == s.idx+1: 668
669 self.enterGroup(s.ref) 669 scene_group = frameline.get_frame_data(start)
670 self.setTweenType(frameline.get_tween_type(s.idx)) 670 self.enterGroup(scene_group)
671 return 671 self.setTweenType(tween_type)
672 else: 672 pass
673 pass
674 i = i + 1
675 continue
676
677 if nth >= (s.idx+1) and nth <= (frameline._keys[i+1].idx+1):
678 self.enterGroup(s.ref)
679 self.setTweenType(frameline.get_tween_type(s.idx))
680 return
681 else:
682 pass
683 i = i + 2
684 pass
685 pass
686 673
687 def setTweenType(self, tween_type): 674 def setTweenType(self, tween_type):
688 sel_type = MBScene._frameline_tween_types.index(tween_type) 675 sel_type = MBScene._frameline_tween_types.index(tween_type)
689 self._disable_tween_type_selector = True 676 self._disable_tween_type_selector = True
690 self.tweenTypeSelector.set_active(sel_type) 677 self.tweenTypeSelector.set_active(sel_type)