# HG changeset patch # User Thinker K.F. Li # Date 1293973775 -28800 # Node ID 8c5492b096f13b93e6474d1da6d354973320fcfd # Parent 42f8cee2118b71c5be36025e9a3e0d1aedd5bbc1 Fix bug of changing tween type diff -r 42f8cee2118b -r 8c5492b096f1 pyink/MBScene.py --- a/pyink/MBScene.py Sun Jan 02 20:51:51 2011 +0800 +++ b/pyink/MBScene.py Sun Jan 02 21:09:35 2011 +0800 @@ -479,6 +479,7 @@ pass pass + # TODO: this function should be removed. def update_scenes_of_dom(self): doc = self._root rdoc = self._doc @@ -1095,17 +1096,16 @@ if self.last_line == None: return frameline = self.last_line - idx = self.last_frame - i = 0 - found = -1 - for start_idx, stop_idx, tween_type in frameline.get_frame_blocks(): - if start_idx <= idx and stop_idx >= idx: - n = self.tweenTypeSelector.get_active() - new_tween_type = MBScene._frameline_tween_types[n] - self.last_line.set_tween_type(start_idx, new_tween_type) - self.update_scenes_of_dom() - break - pass + start, end, old_tween_type = frameline.get_frame_block(self.last_frame) + + type_idx = self.tweenTypeSelector.get_active() + tween_type = MBScene._frameline_tween_types[type_idx] + type_name = self._tween_type_names[type_idx] + + frameline.tween(start, tween_type) + + scene_node = frameline.get_frame_data(start) + scene_node.setAttribute('type', type_name) pass def addTweenTypeSelector(self,hbox): diff -r 42f8cee2118b -r 8c5492b096f1 pyink/frameline.py --- a/pyink/frameline.py Sun Jan 02 20:51:51 2011 +0800 +++ b/pyink/frameline.py Sun Jan 02 21:09:35 2011 +0800 @@ -655,11 +655,6 @@ pass pass - ## Set the frame @idx as the right of a tween - def set_right_tween(self,idx): - pos = self._find_keyframe(idx) - self._keys[pos].right_tween = TRue - def remove_frame(self, idx): pos = self._find_keyframe_floor(idx) if pos != -1: