Mercurial > MadButterfly
comparison pyink/MBScene.py @ 1294:082fff7e9604
merge
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sat, 15 Jan 2011 23:07:29 +0800 |
parents | e816b0c2deec |
children | 71118bff7d61 |
comparison
equal
deleted
inserted
replaced
1293:10bffaffef82 | 1294:082fff7e9604 |
---|---|
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 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() | 122 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() |
122 start, end, tween_type = \ | 123 start, end, tween_type = \ |
123 self._domviewui.get_left_key(layer_idx, frame_idx) | 124 self._domviewui.get_left_key(layer_idx, frame_idx) |
124 tween_len = frame_idx - start + 1 | 125 tween_len = frame_idx - start |
125 self._domviewui.tween(layer_idx, start, tween_len, tween_type) | 126 self._domviewui.tween(layer_idx, start, tween_len, tween_type) |
126 | 127 |
128 # Create a key frame which link to the previous key frame | |
127 scene_group = self._domviewui.get_key_group(layer_idx, start) | 129 scene_group = self._domviewui.get_key_group(layer_idx, start) |
128 self._enterGroup(scene_group) | 130 self._domviewui.mark_key(layer_idx, frame_idx) |
131 self._domviewui.clone_key_group(layer_idx, start, frame_idx) | |
132 self._director.show_scene(frame_idx) | |
133 self.selectSceneObject(layer_idx, frame_idx) | |
129 pass | 134 pass |
130 | 135 |
131 def _enterGroup(self, scene_group): | 136 def _enterGroup(self, scene_group): |
132 self.desktop.setCurrentLayer(scene_group.spitem) | 137 self.desktop.setCurrentLayer(scene_group.spitem) |
133 pass | 138 pass |
151 pass | 156 pass |
152 | 157 |
153 def duplicateKeyScene(self): | 158 def duplicateKeyScene(self): |
154 # Search for the current scene | 159 # Search for the current scene |
155 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() | 160 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() |
161 self.removeKeyScene(layer_idx, frame_idx) | |
156 | 162 |
157 try: | 163 try: |
158 left_start, left_end, left_tween_type = \ | 164 left_start, left_end, left_tween_type = \ |
159 self._domviewui.get_left_key(layer_idx, frame_idx) | 165 self._domviewui.get_left_key(layer_idx, frame_idx) |
160 except: | 166 except: |