# HG changeset patch # User wycc # Date 1293679816 -28800 # Node ID e64b02951627d9defd5921f4a6adf4cb457e3099 # Parent ac5f960ba6cfa9073749a403e9122e84f44c3371 Fix the issue in the normal tween. We duplicate the object only when the object is not in the duplicated node yet. diff -r ac5f960ba6cf -r e64b02951627 pyink/tween.py --- a/pyink/tween.py Thu Dec 30 11:12:34 2010 +0800 +++ b/pyink/tween.py Thu Dec 30 11:30:16 2010 +0800 @@ -63,12 +63,12 @@ pass # Remove duplicate nodes that is not in the set of stop nodes - for node_ref in dup_nodes: - if node_ref not in stop_nodes: - node = dup_nodes[node_ref] - duplicate_group.removeChild(node) - pass - pass + #for node_ref in dup_nodes: + # if node_ref not in stop_nodes: + # node = dup_nodes[node_ref] + # duplicate_group.removeChild(node) + # pass + # pass # # Node ID of a node of start scene must be mapped to @@ -87,9 +87,9 @@ try: stop_node = stop_nodes[start_node_id] except KeyError: - #self.updateTweenObject(duplicate_group, tween_type, - # start_node, start_node, - # percent, dup_node) + self.updateTweenObject(duplicate_group, tween_type, + start_node, start_node, + percent, dup_node) start_node = start_node.next() continue @@ -176,11 +176,10 @@ self.updateTweenObjectScale(obj,s,d,p,newobj) pass elif typ == self.TWEEN_TYPE_NORMAL: - newobj = s.duplicate(self.document) - newobj.setAttribute("ref", s.getAttribute("id")) - top = self.document.createElement("svg:g") - top.appendChild(newobj) - obj.appendChild(top) + if newobj == None: + newobj = s.duplicate(self.document) + newobj.setAttribute("ref", s.getAttribute("id")) + obj.appendChild(newobj) pass def updateTweenObjectScale(self,obj,s,d,p,newobj): @@ -196,9 +195,9 @@ newobj = s.duplicate(self.document) top = self.document.createElement("svg:g") top.setAttribute("ref",s.getAttribute("id")) - top.setAttribute("inkscape:label","dup") top.appendChild(newobj) obj.appendChild(top) + print "aaa" else: top = newobj newobj = top.firstChild()