Mercurial > MadButterfly
comparison pyink/domview_ui.py @ 1247:45e9566ea5c0
Fix bugs of inserting/removing frames.
- tracking layer.scenes when add/remove scene nodes.
- fix buggy add_frame()/rm_frame() of frameline.
- change ID of nodes before inserting when copy nodes from another
group.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 10 Jan 2011 22:15:16 +0800 |
parents | 42c4874c8d1e |
children | 2f9fa5d59e67 |
comparison
equal
deleted
inserted
replaced
1246:42c4874c8d1e | 1247:45e9566ea5c0 |
---|---|
414 # | 414 # |
415 def mark_key(self, layer_idx, key_idx): | 415 def mark_key(self, layer_idx, key_idx): |
416 scene_group = self._dom.add_scene_group(layer_idx) | 416 scene_group = self._dom.add_scene_group(layer_idx) |
417 scene_group_id = scene_group.getAttribute('id') | 417 scene_group_id = scene_group.getAttribute('id') |
418 | 418 |
419 scene_node = self._dom.add_scene_node(key_idx, key_idx) | 419 scene_node = self._dom.add_scene_node(layer_idx, key_idx, key_idx) |
420 self._dom.chg_scene_node(scene_node, ref=scene_group_id) | 420 self._dom.chg_scene_node(scene_node, ref=scene_group_id) |
421 | 421 |
422 self._fl_stack.mark_keyframe(layer_idx, key_idx) | 422 self._fl_stack.mark_keyframe(layer_idx, key_idx) |
423 self._fl_stack.set_keyframe_data(layer_idx, key_idx, scene_node) | 423 self._fl_stack.set_keyframe_data(layer_idx, key_idx, scene_node) |
424 pass | 424 pass |
486 # | 486 # |
487 # All frame at and after given position will shift left, except nearest | 487 # All frame at and after given position will shift left, except nearest |
488 # \ref num frames are removed. | 488 # \ref num frames are removed. |
489 # | 489 # |
490 def rm_frames(self, layer_idx, frame_idx, num): | 490 def rm_frames(self, layer_idx, frame_idx, num): |
491 self._fl_stack.insert_frames(layer_idx, frame_idx, num) | 491 self._fl_stack.rm_frames(layer_idx, frame_idx, num) |
492 self._dom.rm_frames(layer_idx, frame_idx, num) | 492 self._dom.rm_frames(layer_idx, frame_idx, num) |
493 pass | 493 pass |
494 | 494 |
495 ## \brief Insert a layer at given position. | 495 ## \brief Insert a layer at given position. |
496 # | 496 # |