comparison pyink/comp_dock.py @ 1534:199ba528fd4a

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.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 30 Sep 2011 14:17:35 +0800
parents 04b67119df8c
children
comparison
equal deleted inserted replaced
1533:82d3a6b5d1c4 1534:199ba528fd4a
420 model.set_value(itr, 1, True) 420 model.set_value(itr, 1, True)
421 421
422 treeview.set_cursor(path, col, True) 422 treeview.set_cursor(path, col, True)
423 pass 423 pass
424 424
425 ## \brief To check if it is on key frame, now.
426 def _on_key_frame(self):
427 domview = self._domview_ui
428 frame_idx, scene_idx = domview.get_current_frame()
429 try:
430 left_idx, right_idx, ktype = domview.get_key(frame_idx, scene_idx)
431 except ValueError:
432 return False
433 if scene_idx == left_idx or scene_idx == right_idx:
434 return True
435 return False
436
425 def on_link_component_activate(self, *args): 437 def on_link_component_activate(self, *args):
438 if not self._on_key_frame():
439 return
440
426 desktop = self._desktop 441 desktop = self._desktop
427 442
428 comp_name = self._current_component() 443 comp_name = self._current_component()
429 cur_layer_group_sp = desktop.currentLayer() 444 cur_layer_group_sp = desktop.currentLayer()
430 cur_layer_group = cur_layer_group_sp.repr 445 cur_layer_group = cur_layer_group_sp.repr