This is a simple rigging using IK. The empty then follows a path to build a simple smooth motion.
The transform properties are always ‘O’ (constant) for the bones, empty and attached meshes.
I’ve tried using the same python setup to get IPO points to aid in smoothing the curves, but the speed ipo for the path is the only one that shows up. Is there any way to get at the actual transform properties during the animation? The standard IPO/keyframe constructions deliver beautiful 1st order solutions. Changing the lines simply makes mods to the local coordinate system.
If I understand what you’re looking for – transform data from the various objects under constraint expressed in global coordinate system terms like the Transform Properties – then I think you’re going to have to use a BPython solution to access the values from one of the various “spaces” pertinent to the transform in question – world space, armature space, bone space, local space, and the like. Not sure how much has changed since I dug into the API back in v2.44 to do something similar (I needed to get relative angles between flexing bones), but the algorithms I developed from my research still work fine as of v2.48, so I guess it’s safe to assume things haven’t changed much.
Sorry I can’t be more specific, that was a couple of years ago & I haven’t had a need to revisit that part of the API since. I recall reading that the devs were discussing making such values easier to access but I don’t know if it’s been implemented yet.
That is the problem with Blender paths, compared to other 3D systems. Blender does not relay the actual coordinate of the object on the path back to the object itself. I consider this a bug, although the foundation considers it normal operation. I hope this changes in 2.5, but I doubt it because everyone is used to it working this way. It would simplify scripting a great deal. A lot of my 3DSMax scripting was based upon the technique of assigning a dummy object to path, moving through the timeline and then polling the object on the path at each frame to fetch the position and rotation values. This technique does not work in Blender because of the “bug” mentioned above.
This isn’t accessible via some BPython function(s)? At least with bones there were (are?) various variables exposed that could be manipulated to get the needed data.
I’m after the armature and bones. This is the classic string problem. Been using “curves” for each bone to determine the specific location of each bone. When the difference between eval_icu for the quat varies too far from the calculated path position, the program inserts another control point into the location ipo. This approach can be cumbersome since each bone is independent and primarily used to locate and weight meshes.
The IK solver offers a quick solution for rigging setup, so I would like to be able to grab the information in several cases to feed into a string surface solution. glGetFloatv at the point of rendering gets the final rendering matrix. Far too late. I thought about spoofing as a multi-frame ray tracer, but that seems overly complex, so I’m looking for a simpler solution.
OK, call me dense (won’t be be first time) but I haven’t a clue what that last answer means.
I guess It’d just be best to use an example from my own code:
# LIST OF ROTATION MATRICES
# cut and paste as needed for individual bone functions
# ROT_Wspc = ROTSlist[0]
# ROT_Pspc = ROTSlist[1]
# ROT_Aspc = ROTSlist[2]
# ROT_X_Wspc = ROT_Wspc[0]
# ROT_Y_Wspc = ROT_Wspc[1]
# ROT_Z_Wspc = ROT_Wspc[2]
# ROT_X_Pspc = ROT_Pspc[0]
# ROT_Y_Pspc = ROT_Pspc[1]
# ROT_Z_Pspc = ROT_Pspc[2]
# ROT_X_Aspc = ROT_Aspc[0]
# ROT_Y_Aspc = ROT_Aspc[1]
# ROT_Z_Aspc = ROT_Aspc[2]
def getBoneData(DrvrBone):
# specify Armature oject
Armtr = Object.Get('FemBodArmtr-PyD')
# specify Armature
ArmtrAR = Armature.Get('FemBodAR-PyD')
# get the pose data from Armature object
pose = Armtr.getPose()
# get bone
D_Bone = ArmtrAR.bones[DrvrBone]
# get posebone
D_PBone = pose.bones[DrvrBone]
# calc Worldspace matrix
WSMatrix = D_PBone.poseMatrix * Armtr.matrixWorld
# get ROT transforms from bone matrices
# and convert to Euler (degrees)
ROT_Wspc = WSMatrix.rotationPart().toEuler()
ROT_Pspc = D_PBone.poseMatrix.rotationPart().toEuler()
ROT_Aspc = D_Bone.matrix['ARMATURESPACE'].rotationPart().toEuler()
ROT_Bspc = D_Bone.matrix['BONESPACE'].rotationPart().toEuler()
# contruct list of data
ROTSlist = [ROT_Wspc, ROT_Pspc, ROT_Aspc, ROT_Bspc]
return ROTSlist
The commented list is a bunch of variable equates I set up as memory joggers and for use in other functions as needed. It deconstructs the matrices populated in the function getBoneData.
The function accesses the components of various matrices (world, armature, pose and bone spaces) for the bone name ( contained in DrvrBone) passed by the call to the function. It returns a Python list containing various rotation values within those spaces.
You may have to dig in the API to find similar data structures for Location, which I didn’t have any use for.
Yeah, the OpenGL libs will get you all kinds of rendering and image-related stuff, but the Blender API is the better source for Blender-specific info about objects and such. AFAIK it’s been much-updated recently and is a lot more current than I remember it being back while working in 2.44, so that’s a definite plus.