comparison pyink/MBScene.py @ 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
comparison
equal deleted inserted replaced
1323:ffbbd3aa218d 1324:740b3239030e
259 def doRun(self,arg): 259 def doRun(self,arg):
260 """ 260 """
261 Execute the current animation till the last frame. 261 Execute the current animation till the last frame.
262 """ 262 """
263 if self.btnRun.get_label() == "Run": 263 if self.btnRun.get_label() == "Run":
264 #
265 # Make dup groups empty
266 #
267 nlayers = self._domviewui.get_layer_num()
268 for layer_idx in range(nlayers):
269 layer_dup = self._domviewui.get_layer_dup_group(layer_idx)
270 for child in layer_dup.childList():
271 layer_dup.removeChild(child)
272 pass
273 pass
274
264 self.btnRun.set_label("Stop") 275 self.btnRun.set_label("Stop")
265 tmout = 1000 / self.framerate 276 tmout = 1000 / self.framerate
266 self.last_update = glib.timeout_add(tmout, self.doRunNext) 277 self.last_update = glib.timeout_add(tmout, self.doRunNext)
267 else: 278 else:
268 self.btnRun.set_label("Run") 279 self.btnRun.set_label("Run")