comparison pyink/MBScene.py @ 1334:38403fdb0c6c

Fix bug of duplicateKeyScene()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 31 Jan 2011 19:19:46 +0800
parents 2b051e474b0f
children 05ced4a389bf
comparison
equal deleted inserted replaced
1333:3cbc1ab15541 1334:38403fdb0c6c
116 self._domviewui.unmark_key(layer_idx, frame_idx) 116 self._domviewui.unmark_key(layer_idx, frame_idx)
117 self._director.show_scene(frame_idx) 117 self._director.show_scene(frame_idx)
118 pass 118 pass
119 119
120 def extendScene(self): 120 def extendScene(self):
121 # Create a tween 121 # Create a tween
122 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() 122 layer_idx, frame_idx = self._domviewui.get_active_layer_frame()
123 start, end, tween_type = \ 123 start, end, tween_type = \
124 self._domviewui.get_left_key(layer_idx, frame_idx) 124 self._domviewui.get_left_key(layer_idx, frame_idx)
125 tween_len = frame_idx - start 125 tween_len = frame_idx - start
126 self._domviewui.tween(layer_idx, start, tween_len, tween_type) 126 self._domviewui.tween(layer_idx, start, tween_len, tween_type)
127 127
128 # Create a key frame which link to the previous key frame 128 # Create a key frame which link to the previous key frame
129 self._domviewui.mark_key(layer_idx, frame_idx) 129 self._domviewui.mark_key(layer_idx, frame_idx)
130 self._domviewui.clone_key_group(layer_idx, start, frame_idx) 130 self._domviewui.clone_key_group(layer_idx, start, frame_idx)
155 pass 155 pass
156 156
157 def duplicateKeyScene(self): 157 def duplicateKeyScene(self):
158 # Search for the current scene 158 # Search for the current scene
159 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() 159 layer_idx, frame_idx = self._domviewui.get_active_layer_frame()
160 self.removeKeyScene(layer_idx, frame_idx) 160 try:
161 self.removeKeyScene(layer_idx, frame_idx)
162 except: # no key and tween
163 pass
161 164
162 try: 165 try:
163 left_start, left_end, left_tween_type = \ 166 left_start, left_end, left_tween_type = \
164 self._domviewui.get_left_key(layer_idx, frame_idx) 167 self._domviewui.get_left_key(layer_idx, frame_idx)
165 except: 168 except: