0
$\begingroup$

I have downloaded this rigged hand and I am interested in using it to spell letters as they do in sign language. I am using the python prompt to manipulate objects because the ability to do it programmatically is important to my project.

My trouble is I can't figure out how to bend the fingers. The model of the hand has an Armature, which I understand to be some sort of collection of bones. Well anyway, I did this

bpy.context.object.pose.bones['finger_index.01.R'].rotation_euler = [5,5,5]
bpy.context.object.pose.bones.update()

And I expected the finger to move when I did. Why did this not happen, and how do I achieve what I wanted?

$\endgroup$

1 Answer 1

1
$\begingroup$

To do this:

import bpy
import math

ob = bpy.data.objects['Armature']
bpy.context.scene.objects.active = ob
bpy.ops.object.mode_set(mode='POSE')
bonename = 'finger_index.01.R'
pb = ob.pose.bones[bonename]
pb.rotation_mode = 'XYZ'
angleX = 5
angleY = 5
angleZ = 5
pb.rotation_euler =
 (math.radians(angleX),math.radians(angleY),math.radians(angleZ))
bpy.ops.object.mode_set(mode='OBJECT')
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .