changeset 1324:740b3239030e

Clear dup group before running animation. User may change content of groups. TweenObject would not aware the changes if we don't clear the dup group before running animation.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 30 Jan 2011 20:03:21 +0800
parents ffbbd3aa218d
children e155064f6c7e
files pyink/MBScene.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/MBScene.py	Sun Jan 30 19:15:17 2011 +0800
+++ b/pyink/MBScene.py	Sun Jan 30 20:03:21 2011 +0800
@@ -261,6 +261,17 @@
 	    Execute the current animation till the last frame.
 	"""
 	if self.btnRun.get_label() == "Run":
+	    #
+	    # Make dup groups empty
+	    #
+	    nlayers = self._domviewui.get_layer_num()
+	    for layer_idx in range(nlayers):
+		layer_dup = self._domviewui.get_layer_dup_group(layer_idx)
+		for child in layer_dup.childList():
+		    layer_dup.removeChild(child)
+		    pass
+		pass
+	    
 	    self.btnRun.set_label("Stop")
 	    tmout = 1000 / self.framerate
             self.last_update = glib.timeout_add(tmout, self.doRunNext)