# HG changeset patch # User Thinker K.F. Li # Date 1293765014 -28800 # Node ID b65df4f0d30a8ca58713ceb66d91955ec1f38bb9 # Parent 416e41952b764da1c0e254ec4d1b809eed536f86 Change signature of MBScene.insertKeyScene() diff -r 416e41952b76 -r b65df4f0d30a pyink/MBScene.py --- a/pyink/MBScene.py Fri Dec 31 10:43:07 2010 +0800 +++ b/pyink/MBScene.py Fri Dec 31 11:10:14 2010 +0800 @@ -411,7 +411,7 @@ return None - def insertKeyScene(self): + def insertKeyScene(self, line, frame): """ Insert a new key scene into the stage. If the nth is always a key scene, we will return without changing anything. If the @@ -420,12 +420,10 @@ new scene. """ - x = self.last_frame - y = self.last_line rdoc = self.document ns = rdoc.createElement("svg:g") found = False - for node in self.last_line.node.childList(): + for node in line.node.childList(): try: label = node.getAttribute("inkscape:label") except: @@ -451,12 +449,12 @@ txt.setAttribute("style","fill:#ff00") ns.appendChild(txt) - gid = self.last_line.node.getAttribute('inkscape:label')+self.newID() + gid = line.node.getAttribute('inkscape:label')+self.newID() self.ID[gid]=1 ns.setAttribute("id",gid) ns.setAttribute("inkscape:groupmode","layer") - self.last_line.node.appendChild(ns) - self.last_line.add_keyframe(x,ns) + line.node.appendChild(ns) + line.add_keyframe(frame, ns) self.update() pass @@ -687,12 +685,12 @@ btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray")) return btn - def onCellClick(self,line,frame,but): + def onCellClick(self, line, frame, but): self.last_line = line self.last_frame = frame self.last_line.active_frame(frame) self.lockui = True - self.doEditScene(frame) + self.doEditScene(None) self.lockui = False pass @@ -856,12 +854,12 @@ def doEditScene(self, w): self.setCurrentScene(self.last_frame+1) - self.selectSceneObject(self.last_line,self.last_frame) + self.selectSceneObject(self.last_line, self.last_frame) pass def doInsertKeyScene(self,w): self.lockui=True - self.insertKeyScene() + self.insertKeyScene(self.last_line, self.last_frame) self.selectSceneObject(self.last_line, self.last_frame) self.lockui=False # self.grid.show_all() @@ -936,10 +934,6 @@ self.lockui=False def addButtons(self,hbox): - #btn = gtk.Button('Edit') - #btn.connect('clicked', self.doEditScene) - #hbox.pack_start(btn,expand=False,fill=False) - btn = gtk.Button('Insert Key') btn.connect('clicked',self.doInsertKeyScene) hbox.pack_start(btn,expand=False,fill=False)