diff 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
line wrap: on
line diff
--- a/pyink/frameline.py	Wed Jan 05 22:58:03 2011 +0800
+++ b/pyink/frameline.py	Thu Jan 06 09:24:54 2011 +0800
@@ -6,6 +6,7 @@
 import gtk.gdk
 import pango
 import gobject
+import traceback
 
 def color_to_rgb(v):
     return (((v >> 16) & 0xff) * 65535 / 0xff,
@@ -864,6 +865,18 @@
 	pos = self._find_keyframe(idx)
 	key = self._keys[pos]
 	return key.ref
+
+    def search_by_id(self,ID):
+	for k in self._keys:
+	    try:
+		if k.ref == None: continue
+	        if k.ref.getAttribute("ref") == ID:
+		    return k.idx
+	    except:
+		traceback.print_exc()
+		pass
+	    pass
+	return -1
     
     def set_frame_data(self, idx, value):
 	pos = self._find_keyframe(idx)