HI there eversybody.
I am erarly new to Blender and Python so please forgive me for stupid questions.
What I am trying right now is kind of lipsyncing but with bones. OK let’s stqart from scratch. I designed with a mesh a lip. This lip has 8 bones so that if I move one bone it tears a bit of this lip. LAter I want to set these bones dynamically because I am getting some valus out of my system for mouth positions. So now a bone has a head position and a tail position as well as weight and roll value and so on…
My interesst are only on Location (loc), Head and Tail. Using Python and looking into the Blender Python API on blender.org you can use setHead, setTail and setLoc. Well my first question is what do the values say you get back from getLoc?? What do these numbers mean and where is zero position for them?. Then I try to place the Action Keys with setPose. But that isn’t working correctly.
Here is my code bevor I am trying to explain more. Maybe somebody knows a simple example??
import Blender
from Blender import *
from Blender.Armature import *
from Blender.Armature.Bone import *
armObj = Object.New("Armature")
armData = Armature.Get("Armature")
print armData
bn = armData.getBones()
print bn
bn[0].setHead(0.0,0.0,0.0)
bn[0].setTail(2.0,1.0,0.0)
bn[1].setHead(3.0,2.0,1.0)
bn[1].setTail(4.0,4.0,1.0)
armObj.link(armData)
scn = Blender.Scene.getCurrent()
scn.link(armObj)
armObj.makeDisplayList()
Blender.Window.RedrawAll()
bn[1].setPose([ROT,LOC,SIZE])
context = scn.getRenderingContext()
context.currentFrame(2)
bn[1].setLoc([3,4,5])
bn[1].setPose([ROT,LOC,SIZE])
I hope somebody can help me??