From f8391687a5af6bacc39da34fff6977d90f504a58 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 5 Jan 2012 15:22:02 -0500 Subject: [PATCH] Keyframes showing up, selectable --- lightningbeam | 3 ++- svlgui.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lightningbeam b/lightningbeam index 66e6c83..92dba77 100644 --- a/lightningbeam +++ b/lightningbeam @@ -31,6 +31,7 @@ def onLoadFrames(self): def onClickFrame(self, x, y): print x, int(x/16) root.descendItem().activeframe = int(x/16) + MainWindow.stage.draw() def onMouseDownGroup(self, x, y): if svlgui.MODE in [" ", "s"]: if self.hitTest(x, y): @@ -112,7 +113,7 @@ def create_sc(root): def run_file(self=None): global root print "RUNNING" - #open("../Desktop/test.sc", "w").write(create_sc(root)) + open("/Users/skyler/Desktop/test.sc", "w").write(create_sc(root)) def box(x, y, width, height, fill=None): diff --git a/svlgui.py b/svlgui.py index 1a5e1ea..a3a1881 100644 --- a/svlgui.py +++ b/svlgui.py @@ -786,7 +786,7 @@ class Image(object): (src_rect[3]/self.vtiles)*(self.pointer/self.htiles+1)] #src_rect = [16*self.pointer,0,16+16*self.pointer,32] #print [self.x, self.y, self.x+self.image.bounds[2]/self.htiles, self.y+self.image.bounds[3]/self.vtiles] - dst_rect = [0, 0, self.image.bounds[2]/self.htiles, self.image.bounds[3]/self.vtiles] + dst_rect = [self.x, self.y, self.image.bounds[2]/self.htiles+self.x, self.image.bounds[3]/self.vtiles+self.y] self.image.draw(cr, src_rect, dst_rect) else: src_rect = self.image.bounds @@ -1026,11 +1026,16 @@ class Layer: pass def onKeyUp(self, self1, key): pass + def getcurrentselect(self): + return self.frames[self.currentframe].currentselect + def setcurrentselect(self, val): + self.frames[self.currentframe].currentselect = val minx = property(getminx) miny = property(getminy) maxx = property(getmaxx) maxy = property(getmaxy) scale = property(fset = setscale) + currentselect = property(getcurrentselect, setcurrentselect) class frame: class framewrapper (object): #Wraps object per-frame. Allows for changes in position, rotation, scale. @@ -1184,7 +1189,6 @@ class Layer: self.level = False self.clicked = False self.hidden = False - self.currentselect = None def parse_obj(obj): self.objs.append(obj) obj.x=obj.x-self.x @@ -1350,6 +1354,9 @@ class Group (object): def getactiveframe(self): return self.activelayer.activeframe def setactiveframe(self, frame): + print self.activelayer.frames + if frame