comparison pyink/domview_ui.py @ 1259:df474448364e

Add find_layer_from_group() for domview_ui
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 11 Jan 2011 17:39:06 +0800
parents 2609b219703d
children 6177f5d0ef01
comparison
equal deleted inserted replaced
1258:2609b219703d 1259:df474448364e
540 ## \brief Find an associated key frame and tween info for a group ID. 540 ## \brief Find an associated key frame and tween info for a group ID.
541 # 541 #
542 def find_key_from_group(self, scene_group_id): 542 def find_key_from_group(self, scene_group_id):
543 layer_idx, scene_node = \ 543 layer_idx, scene_node = \
544 self._dom.find_layer_n_scene_of_node(scene_group_id) 544 self._dom.find_layer_n_scene_of_node(scene_group_id)
545 if layer_idx == -1:
546 raise ValueError, \
547 'can not find the key for group %s' % (scene_group_id)
545 start, end, tween_name = self._dom._parse_one_scene(scene_node) 548 start, end, tween_name = self._dom._parse_one_scene(scene_node)
546 tween_type = self._tween_type_names.index(tween_name) 549 tween_type = self._tween_type_names.index(tween_name)
547 return layer_idx, (start, end, tween_type) 550 return layer_idx, (start, end, tween_type)
548 551
549 ## \brief Return key and tween info for given frame index. 552 ## \brief Return key and tween info for given frame index.
587 # The callback function is called when a frame is activated. 590 # The callback function is called when a frame is activated.
588 # 591 #
589 def register_active_frame_callback(self, cb): 592 def register_active_frame_callback(self, cb):
590 self._fl_stack.register_active_frame_callback(cb) 593 self._fl_stack.register_active_frame_callback(cb)
591 pass 594 pass
595
596 ## \brief Find the layer index associated with a given layer group.
597 #
598 def find_layer_from_group(self, group_id):
599 layer_idx = self._domview.find_layer_from_group(group_id)
600 if layer_idx == -1:
601 raise ValueError, \
602 'can not find the layer for group %s' % (group_id)
603 return layer_idx
592 604
593 ## \brief Get duplicate group of a layer. 605 ## \brief Get duplicate group of a layer.
594 # 606 #
595 def get_layer_dup_group(self, layer_idx): 607 def get_layer_dup_group(self, layer_idx):
596 data = self._dom.get_layer_data(layer_idx) 608 data = self._dom.get_layer_data(layer_idx)