comparison pyink/frameline.py @ 1221:33aa2d63e240

When we select a new object, search the scene group which contain it and make it as the active frame.
author wycc
date Thu, 06 Jan 2011 09:24:54 +0800
parents 93acb8568ad3
children 5d731460b32c
comparison
equal deleted inserted replaced
1220:9425733a677e 1221:33aa2d63e240
4 pygtk.require("2.0") 4 pygtk.require("2.0")
5 import gtk 5 import gtk
6 import gtk.gdk 6 import gtk.gdk
7 import pango 7 import pango
8 import gobject 8 import gobject
9 import traceback
9 10
10 def color_to_rgb(v): 11 def color_to_rgb(v):
11 return (((v >> 16) & 0xff) * 65535 / 0xff, 12 return (((v >> 16) & 0xff) * 65535 / 0xff,
12 ((v >> 8) & 0xff) * 65535 / 0xff, 13 ((v >> 8) & 0xff) * 65535 / 0xff,
13 (v & 0xff) * 65535 / 0xff) 14 (v & 0xff) * 65535 / 0xff)
862 863
863 def get_frame_data(self, idx): 864 def get_frame_data(self, idx):
864 pos = self._find_keyframe(idx) 865 pos = self._find_keyframe(idx)
865 key = self._keys[pos] 866 key = self._keys[pos]
866 return key.ref 867 return key.ref
868
869 def search_by_id(self,ID):
870 for k in self._keys:
871 try:
872 if k.ref == None: continue
873 if k.ref.getAttribute("ref") == ID:
874 return k.idx
875 except:
876 traceback.print_exc()
877 pass
878 pass
879 return -1
867 880
868 def set_frame_data(self, idx, value): 881 def set_frame_data(self, idx, value):
869 pos = self._find_keyframe(idx) 882 pos = self._find_keyframe(idx)
870 key = self._keys[pos] 883 key = self._keys[pos]
871 key.ref = value 884 key.ref = value