Mercurial > MadButterfly
comparison pyink/consistency.py @ 1257:027cd060d9ba
Remove the key frame if associated scene node or scene group being removed.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 11 Jan 2011 15:03:01 +0800 |
parents | 07e0cb1e051d |
children | 6177f5d0ef01 |
comparison
equal
deleted
inserted
replaced
1256:8755415b5e99 | 1257:027cd060d9ba |
---|---|
49 self._root = root | 49 self._root = root |
50 | 50 |
51 self._start_check() | 51 self._start_check() |
52 pass | 52 pass |
53 | 53 |
54 def _remove_node_recursive(self, node, child): | |
55 for cchild in child.childList(): | |
56 self._remove_node_recursive(child, cchild) | |
57 pass | |
58 | |
59 child_name = child.name() | |
60 if child_name not in ('ns0:scene', 'svg:g'): | |
61 return | |
62 | |
63 # | |
64 # Remove the key frame assocated with a removed scene node or | |
65 # scene group if we can find the key frame. | |
66 # | |
67 if child_name == 'ns0:scene': | |
68 try: | |
69 group_id = child.getAttribute('ref') | |
70 except: | |
71 return | |
72 elif child_name == 'svg:g': | |
73 try: | |
74 group_id = child.getAttribute('id') | |
75 except: | |
76 return | |
77 pass | |
78 | |
79 try: | |
80 layer_idx, (start, end, tween_type) = \ | |
81 self._domview.find_key_from_group(group_id) | |
82 except ValueError: | |
83 pass | |
84 else: # We have found the key frame. | |
85 self._domview.unmark_key(layer_idx, start) | |
86 pass | |
87 pass | |
88 | |
54 def do_insert_node(self, node, child): | 89 def do_insert_node(self, node, child): |
55 pass | 90 pass |
56 | 91 |
57 def do_remove_node(self, node, child): | 92 def do_remove_node(self, node, child): |
93 self._remove_node_recursive(node, child) | |
58 pass | 94 pass |
59 | 95 |
60 def do_attr_modified(self, node, name, old_value, new_value): | 96 def do_attr_modified(self, node, name, old_value, new_value): |
61 pass | 97 pass |
62 pass | 98 pass |