(edit - nevermind, see below)
Hello. I'm a developer currently working on the Torque Game Engine DTS Exporter for Blender.
One of the most requested features from users of the exporter is the ability to export animations that are created using the various constraint types. Right now, it is only possible to export animations created using "targetless IK" and FK. For more complex rigs, it is highly desirable to be able to use the other constraint types.
In order to make this happen, I need access to the final calculated bone transforms after all constraints have been applied. I was under the (apparently) mistaken impression that the new pose API in Blender 2.41 would help to solve this problem. I have run a number of tests using the "bf-blender / Windows 2.41RC1 (2006/1/17) RC BUILD" and it is quite clear that the poseMatrix property of the posebones does not take any of the constraints into account.
Would it be possible to give us read only access to this data in a future version of blender?
Thanks,
Joseph Greenawalt
Last edited by jsgreenawalt on Tue Jan 24, 2006 7:53 pm; edited 1 time in total
Nevermind

I feel incredibly stupid. The poseMatrix already contains the values I need. The problem was that I was running my test scripts from one of the aux screens (ctrl-left arrow) with no 3d view visible. This was causing my code that was supposed to be cycling through the frames to do nothing. My appologies for requesting a feature that already exists
how exactly are you cycling through the frames? i had a 3d view visible but this didn't seem to work for me like in my example in this thread:
http://www.blender.org/forum/viewtopic.php?t=7678&postdays=0&postorder=asc&start=0
Here's my latest test script:
| Code: |
import Blender
from Blender import *
arm = Blender.Object.Get('Armature')
armData = arm.getData()
act = Blender.Armature.NLA.GetActions()['Action']
act.setActive(arm)
def getPosesForFrame(frame):
print "At Frame %i" % frame
Blender.Set("curframe", frame)
Blender.Window.Redraw()
pose = arm.getPose()
for bonename in armData.bones.values():
print "Bone %s poseMatrix:" % bonename.name
print pose.bones[bonename.name].poseMatrix
print "*****************************"
getPosesForFrame(1)
getPosesForFrame(20)
print "*****************************"
|
I am using another bone in my armature as the constraint target (don't know if it will work w/ empties), Have tested with "track to", "copy rotation", and IK. Seems to be working well so far.
thanks, i will try again. maybe it's because of your two lines dealing with the action? are they necessary?
Yes, I believe they are. I think that if you don't set an active action for your armature it won't work properly.