Hi everybody,
I’m a French student and I had to work in Python for my studies.
I want to write a script which make move a mesh by Bone. So, I take a blender file with an Human inside. To try, I draw 3 Bones to make the arm move. Each are child of parent of another, in the same armature. After that, I link these Bones to parts of my Mesh. When I turn my 3D view in “Pose Mode”, I can control the arm of my “mannequin” by moving its Bones. For the moment, everything is OK. But my problem is when I want to reproduce the movements of the Bones made with my mouse in a Python script.
With the “Python scripting reference” in the Blender Help I found the Class and the Module which let me to command the Bones and the Amrmature. When I run the script I wrote, it move the bone as I’ve write (good point) but the meshes doesn’t come with (bad point), even I’m in “Pose Mode”. So I think I don’t use the good instructions…
My code :
import Blender
from Blender import Armature
from Blender.Mathutils import *
armatures = Armature.Get()
arm = armatures.values()[0]
arm.makeEditable()
eb = Armature.Editbone()
eb = arm.bones["Bone.001"]
eb.head = (1, 1, 1)
arm.update()