I'm trying to render different images of hand gestures using python, but for some reason, I'm unable to get the hand armature bones to move. I'm using Manuel Bastoni for the model. http://www.manuelbastioni.com/
Here's the code that I have right now:
bpy.ops.object.mode_set(mode='POSE')
for bone in bones:
x = bone.location[0] + random.uniform(-0.2, 0.2)
y = bone.location[1] + random.uniform(-0.2, 0.2)
z = bone.location[2] + random.uniform(-0.2, 0.2)
bone.location[0] = x
bone.location[1] = y
bone.location[2] = z
bpy.context.scene.update()
bpy.context.scene.render.filepath = outfile_name
bpy.ops.render.render(write_still=True)
I saw that in the python console, bone.location = (x, y, z) works perfectly fine to manipulate the bones, but it's not working here.
Please let me know what I can do to manipulate the pose bones through a python script!
Thanks!
rig = bpy.context.scene.objects['f_ca01_skeleton'] bones = list(rig.pose.bones)Is there any other way for me to access the armature? Thank you! – user58033 Jun 21 '18 at 16:40