Mercurial > MadButterfly
diff pyink/frameline.py @ 1180:bfd7d466a022
Fix yeiling error message when select a scene.
- It is caused by the buggy fixing of changeset #7d700e5f82ba for an
eariler error of frameline.get_frame_block()
- Fix frameline.get_frame_block() with correct logic and fix early
code relied on the buggy fix.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 31 Dec 2010 11:31:18 +0800 |
parents | 96a7abce774a |
children | 9d715956823a 0e3a65b7b00c |
line wrap: on
line diff
--- a/pyink/frameline.py Fri Dec 31 11:10:14 2010 +0800 +++ b/pyink/frameline.py Fri Dec 31 11:31:18 2010 +0800 @@ -708,7 +708,7 @@ return pass pass - pass + def rm_keyframe(self, idx): key_pos = self._find_keyframe(idx) key = self._keys[key_pos] @@ -765,6 +765,10 @@ pass pass + ## \bref Return range of blocks of conesequence frames (tweens). + # + # Return range and type of tweens and key frames that is not start or stop + # of a tween. def get_frame_blocks(self): blocks = [] for pos, key in enumerate(self._keys): @@ -779,18 +783,27 @@ pass return blocks + ## \brief Return the range of a block of consequence frames (tween). + # + # - If the index frame is in a tween, it returns the range of the tween. + # + # - If the indexed frame is a key frame with no right_tween, returns the + # range that start and stop are both equivalent to idx. + # + # - Otherwise, raise an exception. + # + # \param idx is the index number of a frame. + # \return A tuple of (start, stop, tween_type) + # def get_frame_block(self, idx): pos = self._find_keyframe_floor(idx) if pos != -1: key = self._keys[pos] - print key.right_tween, key.left_tween - if key.idx == idx: - return key.idx, key.idx, 0 - elif key.right_tween: + if key.right_tween: next_key = self._keys[pos + 1] return key.idx, next_key.idx, key.right_tween_type - else: - return -1,-1,-1 + elif key.idx == idx: + return key.idx, key.idx, 0 pass raise ValueError, \ 'the frame specified by idx is not in any tween or a key frame'