Knowing the names of the bone and the armature, I would like to animate the bone by setting the location and/or rotation of the bone starting from say frame 24 to 48. I'm an absolute beginner and I googled but I'm still confused.
I use this code to translate and rotate:
bpy.ops.transform.translate(value=(0, 1, 0), orient_type='GLOBAL') bpy.ops.transform.rotate(value=1.5708, orient_axis='X', orient_type='GLOBAL')
They work only when I manually select the bone (by clicking it). so I tried to use this code to set the active bone but it didn't work:
bpy.data.objects["Armature"].data.bones["Bone"].select = True
Would you help me, please?
I enter Pose mode using this code: