Skip to content

Instantly share code, notes, and snippets.

@hiroakioishi
Last active August 29, 2015 14:22
Show Gist options
  • Save hiroakioishi/b72c5ec028ff47afe301 to your computer and use it in GitHub Desktop.
Save hiroakioishi/b72c5ec028ff47afe301 to your computer and use it in GitHub Desktop.
[Blender:Python] 指定した名前のアクションのキーフレームの配列を返す
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