changeset 1178:416e41952b76

Fix issue that pyink does not switch current layer to the new key scene. - After insert a new key scene, pyink does switch current layer to the new scene. It is supposed to have. - calls selectSceneObject() in doInsertKeyScene().
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 31 Dec 2010 10:43:07 +0800
parents ec1ea8555911
children b65df4f0d30a
files pyink/MBScene.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/MBScene.py	Fri Dec 31 10:29:21 2010 +0800
+++ b/pyink/MBScene.py	Fri Dec 31 10:43:07 2010 +0800
@@ -660,9 +660,9 @@
 	    pass
 	pass
     
-    def selectSceneObject(self, frameline, nth):
+    def selectSceneObject(self, frameline, frame_idx):
 	try:
-	    start, stop, tween_type = frameline.get_frame_block(nth - 1)
+	    start, stop, tween_type = frameline.get_frame_block(frame_idx)
 	except:
 	    return
 
@@ -854,14 +854,15 @@
 	self.last_line.node.appendChild(ns)
 	return ns
     
-    def doEditScene(self,w):
+    def doEditScene(self, w):
 	self.setCurrentScene(self.last_frame+1)
-	self.selectSceneObject(self.last_line,self.last_frame+1)
+	self.selectSceneObject(self.last_line,self.last_frame)
 	pass
     
     def doInsertKeyScene(self,w):
 	self.lockui=True
 	self.insertKeyScene()
+	self.selectSceneObject(self.last_line, self.last_frame)
 	self.lockui=False
 	# self.grid.show_all()
 	return