Last active
April 16, 2022 13:39
-
-
Save dskjal/54575a1d8b511b71f24d52754314427c to your computer and use it in GitHub Desktop.
Blender でスクリプトからボーンにキーフレームを打つ
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
#ボーンを選択していなくてもできる | |
bpy.context.active_object.pose.bones['hand.ik.L'].keyframe_insert(data_path='location',group='hand.ik.L') | |
#ボーンを選択して以下のコマンドでも可能(ただし遅い) | |
bpy.ops.anim.keyframe_insert_menu(type='LocRotScale') | |
#ボーンを選択 | |
bpy.ops.pose.select_all(action="DESELECT") | |
bpy.context.active_object.data.bones['hand.ik.L'].select = True | |
#ボーンに設定されたプロパティにキーを打つ | |
#data_path は UI を右クリックして,Copy Data Path でコピーする | |
bpy.context.active_object.pose.bones['hand.ik.L'].id_data.keyframe_insert(data_path='pose.bones["hand.ik.L"]["ikfk_switch"]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment