changeset 1091:71354f3e2a30 openvg

Merge from default
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 03 Dec 2010 22:21:41 +0800
parents 762d1e3795f3 (current diff) afa42d5836cc (diff)
children e9f617b21db1 6a451e968c3c
files
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/MBScene.py	Fri Dec 03 22:17:12 2010 +0800
+++ b/pyink/MBScene.py	Fri Dec 03 22:21:41 2010 +0800
@@ -421,6 +421,34 @@
 		pass
 	    pass
 	pass
+    def enterGroup(self,obj):
+        for l in self.layers:
+	    for s in l.node.childList():
+	        if s.getId() == obj.attribute("id"):
+		    self.desktop.setCurrentLayer(s)
+        
+    def selectSceneObject(self,frameline, nth):
+        i = 0
+        while i < len(frameline._keys):
+	    s = frameline._keys[i]
+	    if s.right_tween is False:
+	        if nth == s.idx+1:
+		    self.enterGroup(s.ref)
+		    return
+		else:
+		    pass
+		i = i + 1
+		continue
+
+	    if nth >= (s.idx+1) and nth <= (frameline._keys[i+1].idx+1):
+	        self.enterGroup(s.ref)
+		return
+	    else:
+	        pass
+	    i = i + 2
+	    pass
+        pass
+
 	
 	
     def newCell(self,file):
@@ -521,9 +549,11 @@
 	color = cell.get_colormap().alloc_color("green")
 	cell.modify_bg(gtk.STATE_NORMAL, color)
 	pass
+	    
     
     def doEditScene(self,w):
 	self.setCurrentScene(self.last_frame+1)
+	self.selectSceneObject(self.last_line,self.last_frame+1)
 	pass
     
     def doInsertKeyScene(self,w):