comparison pyink/MBScene.py @ 1070:afa42d5836cc

Call setCurrentLayer to enter the current scene group.
author wycc
date Thu, 02 Dec 2010 08:23:08 +0800
parents 16c69756ef5d
children 52d8bf5d12b4
comparison
equal deleted inserted replaced
1066:292fbb86d8f3 1070:afa42d5836cc
419 s.ref.setAttribute("style","display:none",True) 419 s.ref.setAttribute("style","display:none",True)
420 i = i + 2 420 i = i + 2
421 pass 421 pass
422 pass 422 pass
423 pass 423 pass
424 def enterGroup(self,obj):
425 for l in self.layers:
426 for s in l.node.childList():
427 if s.getId() == obj.attribute("id"):
428 self.desktop.setCurrentLayer(s)
429
430 def selectSceneObject(self,frameline, nth):
431 i = 0
432 while i < len(frameline._keys):
433 s = frameline._keys[i]
434 if s.right_tween is False:
435 if nth == s.idx+1:
436 self.enterGroup(s.ref)
437 return
438 else:
439 pass
440 i = i + 1
441 continue
442
443 if nth >= (s.idx+1) and nth <= (frameline._keys[i+1].idx+1):
444 self.enterGroup(s.ref)
445 return
446 else:
447 pass
448 i = i + 2
449 pass
450 pass
451
424 452
425 453
426 def newCell(self,file): 454 def newCell(self,file):
427 img = gtk.Image() 455 img = gtk.Image()
428 img.set_from_file(file) 456 img.set_from_file(file)
519 547
520 self.last_cell = cell 548 self.last_cell = cell
521 color = cell.get_colormap().alloc_color("green") 549 color = cell.get_colormap().alloc_color("green")
522 cell.modify_bg(gtk.STATE_NORMAL, color) 550 cell.modify_bg(gtk.STATE_NORMAL, color)
523 pass 551 pass
552
524 553
525 def doEditScene(self,w): 554 def doEditScene(self,w):
526 self.setCurrentScene(self.last_frame+1) 555 self.setCurrentScene(self.last_frame+1)
556 self.selectSceneObject(self.last_line,self.last_frame+1)
527 pass 557 pass
528 558
529 def doInsertKeyScene(self,w): 559 def doInsertKeyScene(self,w):
530 self.insertKeyScene() 560 self.insertKeyScene()
531 # self.grid.show_all() 561 # self.grid.show_all()