Hello,
I am currently experimenting on combining MD5 biped skeleton animations with software generated animations.
Loading biped animations and using them with SmoothSkeletonAnimator is easy thanks to several code examples and tutorials available.
I am currently using modified animator based on this example kindly provided by Huck: /forum/viewthread/1732/
I am able to create UserAnimator and do bone transformations in UserSkeletonTreeNode
However, I haven’t been able to figure out how to use the default pose in MD5 mesh skeleton as a starting point for transformations.
After the mesh asset loading is completed I create the SkeletonAnimationState object that is passed to the userAnimator.
var animationState:SkeletonAnimationState = (mesh.animationState as SkeletonAnimationState);
this._userAnimator = new UserAnimator(animationState);
this._userAnimator.play();
What I know is when I look at animationState.globalPose.numJointPoses there is 0 jointPoses found. This is logical since there is no animation loaded - only mesh and skeleton.
When I trace joints in Skeleton asset the default joint pose information is found for every joint.
for (var f:int = 0; f < skeleton.numJoints; f++) {
var raw : Vector.<Number>;
raw = skeleton.joints[f].inverseBindPose;
trace("Joint " + f + ": " + raw);
}
Output:
Joint 0: -1.0511376657973415e-8,-1,0.000001624773631192511,0,0.9986786842346191,7.29989650949392e-8,0.05138958618044853,0,-0.05138958990573883,0.000001623167008801829,0.9986786246299744,0,-36.06052017211914,-0.0000026358632112533087,-1.8555868864059448,1
Joint 1: -0.04423442855477333,-0.999020516872406,0.0011065446306020021,0,0.9977037906646729,-0.044119205325841904,0.05138813704252243,0,-0.05128898471593857,0.003377128392457962,0.9986781477928162,0,-40.94342041015625,1.1858314275741577,-2.1067187786102295,1
...
I might be completely lost but my idea is that I could take the joint inverseBindPose data and somehow inject that to SkeletonAnimationState.globalPose.jointPoses as a basis for my UserAnimator transformations.
It is highly appreciated if someone could point me the right direction?
-Antti