# HG changeset patch # User Thinker K.F. Li # Date 1317363455 -28800 # Node ID 199ba528fd4a5867dc4dc4a51c87cc758715c831 # Parent 82d3a6b5d1c46b97be6ca7dbff1f7daeea238628 Only insert a link to a component to a key frame. - To check if it is a key frame, now, before inserting a link to a component. - When it is not in a key frame, it is supposed to be a "dup" group. We should not make a link there. diff -r 82d3a6b5d1c4 -r 199ba528fd4a pyink/comp_dock.py --- a/pyink/comp_dock.py Fri Sep 30 12:53:19 2011 +0800 +++ b/pyink/comp_dock.py Fri Sep 30 14:17:35 2011 +0800 @@ -422,7 +422,22 @@ treeview.set_cursor(path, col, True) pass + ## \brief To check if it is on key frame, now. + def _on_key_frame(self): + domview = self._domview_ui + frame_idx, scene_idx = domview.get_current_frame() + try: + left_idx, right_idx, ktype = domview.get_key(frame_idx, scene_idx) + except ValueError: + return False + if scene_idx == left_idx or scene_idx == right_idx: + return True + return False + def on_link_component_activate(self, *args): + if not self._on_key_frame(): + return + desktop = self._desktop comp_name = self._current_component()