Page MenuHome

Fix T44690: BVH exporter writes frame positions relative to joint rest position
Needs RevisionPublic

Authored by Jonas H (duststorm) on May 22 2015, 1:12 AM.

Details

Summary

Modifies the BVH exporter plugin to to only write the relative translation of a joint in the frame data. Also modifies the importer to be compatible with this.

Diff Detail

Event Timeline

Jonas H (duststorm) retitled this revision from to Fix T44690: BVH exporter writes frame positions relative to joint rest position.
Jonas H (duststorm) updated this object.
Jonas H (duststorm) set the repository for this revision to rBA Blender Add-ons.
Campbell Barton (campbellbarton) requested changes to this revision.May 29 2015, 8:10 AM
Campbell Barton (campbellbarton) edited edge metadata.

Its not clear if this is a bugfix or just changing internal logic. Why is this needed and what does it solve exactly?

This revision now requires changes to proceed.May 29 2015, 8:10 AM
Jonas H (duststorm) added a comment.EditedSep 25 2015, 4:00 PM

Its not clear if this is a bugfix or just changing internal logic. Why is this needed and what does it solve exactly?

It's a bugfix as the exporter was not following the BVH spec.
In T44690 I pointed to some references that contradict the implementation of Blender's BVH exporter, along with examples of other software that imports the BVH files wrongly because of this bug.

Is there software that requires BVH files to be structured the way Blender currently does it?

Citations:

Blender Exporter seems to treat frames as absolute positions not as relative to the root. It improperly displaces the root {These references all agree that the position frame channels are translations, and not absolute positions:
http://www.dcs.shef.ac.uk/intranet/research/public/resmes/CS0111.pdf
Refer to equation 3.2 on page 8 and the description next to it.
"Therefore,Tx,Ty and Tz represent the summation of abone’s base position and frame translation data."

http://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
"The rot filesation data comes from the motion section. For the root object, the translation data will be the sum of the offset data and the translation data from the motion section"

Why is this needed and what does it solve exactly?

This patch solves a bug in the BVH exporter: If you export a BVH from an armature with its root bone not at origin (the bone head in rest pose), this offset from root is added to the animation data, instead of in the static node description.

If you always use armatures with a root bone starting at origin, you don't notice this problem, but in all other cases you do.