Question

i have been trying to get motion data from a bvh file and applying it to my 3d models.I made study about bvh file format, and parsed its data and written the data in a text file, lets give the new extension (.motion) for the text file. Everything is fine, but problem arises when i try to apply .motion data to my 3d model's joints.

Because the rest pose of the bvh file differs.My model's rest pose is T-Pose,but bvh file's is standing pose.So the whole animation sequence applied in my 3d model also differs in its rotation.

i also verified whether the rotation data is applied to the correct joint or not

so everything is perfect except the rest pose. is there any other way to overcome this rest position difference. Can i use matrix multiplication to solve this problem ?

Was it helpful?

Solution

Answering my own question.I have written the python script that writes the global rotation of the bones for each frame, and i just applied the rotations to other armature (with different rest pose)and now the animation can be easily copied independent of rest pose.

pose.bone[boneIndex].matrix.decompose()[1] //global rotation of bone in Quaternion

if we apply the global rotation of one armature to another , then the rest poses of both the armatures are not necessary to be same.But if we try to apply the local (relative )rotations of the bones to other armature , then the both armatures should have same rest pose.

Steps :

1) Import the BVH file in blender.

2) Run the python script the writes the global rotation(in quaternion) of each bone per frame .

3) Now apply the quaternion directly to your 3d model's bones.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top