Last active
August 29, 2015 14:22
-
-
Save hiroakioishi/b72c5ec028ff47afe301 to your computer and use it in GitHub Desktop.
[Blender:Python] 指定した名前のアクションのキーフレームの配列を返す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_keyframes(action_name): | |
keyframes = [] | |
action = bpy.data.actions[action_name] | |
if action is not None and action is not None: | |
for fcu in action.fcurves: | |
for keyframe in fcu.keyframe_points: | |
x, y = keyframe.co | |
if x not in keyframes: | |
keyframes.append((math.ceil(x))) | |
return keyframes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment