comparison pyink/tween.py @ 1163:c23593881507

Merge. Fix a bug to select the tween without key frame after it.
author wycc
date Tue, 28 Dec 2010 22:26:11 +0800
parents 1a699dc00fa3
children 6160e6282252
comparison
equal deleted inserted replaced
1162:64c54ef39480 1163:c23593881507
58 node_label = node.getAttribute("ns0:duplicate-src") 58 node_label = node.getAttribute("ns0:duplicate-src")
59 stop_nodes[node_label] = node 59 stop_nodes[node_label] = node
60 except: 60 except:
61 pass 61 pass
62 node = node.next() 62 node = node.next()
63 pass
64
65 # Remove duplicate nodes that is not in the set of stop nodes
66 for node_ref in dup_nodes:
67 if node_ref not in stop_nodes:
68 node = dup_nodes[node_ref]
69 duplicate_group.removeChild(node)
70 pass
63 pass 71 pass
64 72
65 # 73 #
66 # Node ID of a node of start scene must be mapped to 74 # Node ID of a node of start scene must be mapped to
67 # 'ns0:duplicate-src' attribute of a node of stop scene. The 75 # 'ns0:duplicate-src' attribute of a node of stop scene. The
73 # one in the duplicated scene. 81 # one in the duplicated scene.
74 # 82 #
75 start_node = start_scene_group.firstChild() 83 start_node = start_scene_group.firstChild()
76 while start_node: 84 while start_node:
77 start_node_id = start_node.getAttribute('id') 85 start_node_id = start_node.getAttribute('id')
86 dup_node = dup_nodes.setdefault(start_node_id, None)
78 try: 87 try:
79 stop_node = stop_nodes[start_node_id] 88 stop_node = stop_nodes[start_node_id]
80 except KeyError: 89 except KeyError:
81 self.updateTweenObject(duplicate_group, tween_type, 90 self.updateTweenObject(duplicate_group, tween_type,
82 start_node, start_node, 91 start_node, start_node,
83 percent, dup_node) 92 percent, dup_node)
84 start_node = start_node.next() 93 start_node = start_node.next()
85 continue 94 continue
86 95
87 dup_node = dup_nodes.setdefault(start_node_id, None)
88 96
89 self.updateTweenObject(duplicate_group, tween_type, 97 self.updateTweenObject(duplicate_group, tween_type,
90 start_node, stop_node, 98 start_node, stop_node,
91 percent, dup_node) 99 percent, dup_node)
92 start_node = start_node.next() 100 start_node = start_node.next()