Mercurial > MadButterfly
diff pyink/frameline.py @ 1163:c23593881507
Merge.
Fix a bug to select the tween without key frame after it.
author | wycc |
---|---|
date | Tue, 28 Dec 2010 22:26:11 +0800 |
parents | a7faab54e8f8 |
children | 2cb5047d8f2b |
line wrap: on
line diff
--- a/pyink/frameline.py Mon Dec 27 23:20:13 2010 +0800 +++ b/pyink/frameline.py Tue Dec 28 22:26:11 2010 +0800 @@ -370,6 +370,12 @@ self._draw_tween(first_tween_key.idx, last_tween_key.idx, first_tween_key.right_tween_type) last_tween_key = self._keys[last_tween_pos] + key_pos = last_tween_pos + 1 + try: + key = self._keys[key_pos] + except: + key = keyframe(self._num_frames) + pass i = last_tween_key.idx + 1 else: self._draw_normal_frame(i) @@ -704,7 +710,8 @@ block = (key.idx, next_key.idx, key.right_tween_type) elif not key.left_tween: block = (key.idx, key.idx, 0) - pass + else: + continue blocks.append(block) pass return blocks @@ -713,11 +720,14 @@ 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: next_key = self._keys[pos + 1] return key.idx, next_key.idx, key.right_tween_type + else: + return -1,-1,-1 pass raise ValueError, \ 'the frame specified by idx is not in any tween or a key frame'