# HG changeset patch # User Thinker K.F. Li # Date 1293514534 -28800 # Node ID 1a699dc00fa3423fc8e6d6e5e2dd7b5481cdb0ff # Parent e731a0eaa35f7a0cc812fcb3464cfef2b1f9f7b1 Fix the issue of not removing node in old scene when switching scenes. - When a timeline is playing and crossing two scenes (tween block), nodes, for the old scene, in duplicate group must be removed. But, it is not. - It is fixed by checking if nodes, in the duplicate group, are also in the key frame next to the new scene. All nodes that is not in next key frame are remove. diff -r e731a0eaa35f -r 1a699dc00fa3 pyink/MBScene.py --- a/pyink/MBScene.py Tue Dec 28 13:35:34 2010 +0800 +++ b/pyink/MBScene.py Tue Dec 28 13:35:34 2010 +0800 @@ -605,7 +605,7 @@ layer.get_frame_block(stop_idx + 1) next_scene_group = layer.get_frame_data(next_idx) - nframes = next_idx - start_idx + 1 + nframes = stop_idx - start_idx + 1 percent = float(idx - start_idx) / nframes self.tween.updateTweenContent(layer.duplicateGroup, tween_obj_tween_type, diff -r e731a0eaa35f -r 1a699dc00fa3 pyink/tween.py --- a/pyink/tween.py Tue Dec 28 13:35:34 2010 +0800 +++ b/pyink/tween.py Tue Dec 28 13:35:34 2010 +0800 @@ -62,6 +62,14 @@ node = node.next() 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 + # # Node ID of a node of start scene must be mapped to # 'ns0:duplicate-src' attribute of a node of stop scene. The