Extensions:2.6/Py/Scripts/Import-Export/BVH Importer Exporter

提供: wiki
移動先: 案内検索

BVH importer & exporter

BVH Addon
Export/Import motion capture data in Biovision Hierarchy (BVH) format
UI location Import, Export
Usage Import/Export animated armatures in BVH format
Version 2.76 Author(s) Campbell Barton (ideasman_42), Sybren A. Stüvel
Blender 2.76 License GNU General Public License (GPL)


Executable information
File name io_anim_bvh



Units and coordinate systems

The BVH file format does not specify the units of measurement used, nor does it specify the coordinate system. Because of this, importing or exporting BVH files requires a few manual choices. BVH animations have a fixed frame rate, which is always specified in seconds per frame.

Common unit choices

Common units are:

  • metres: always a sane choice
  • centimetres: some Vicon software uses this
  • 1/100th inches: other Vicon software uses this. If you have such files, you can enter "2.54/100" or "0.0254" in the scale field to convert to metres.

Common coordinate systems

Common coordinate systems are:

Y=up, -Z=forward
Vicon software uses this, and it is the most common choice in many BVH files found online. For these reasons, this is also the importer's default.
Z=up, Y=forward
as in Blender, but this does not seem to be widely used in BVH files.

Importer

The importer has the following options:

Forward and Up
The coordinate axes that denotes the "forward" and "up" direction. The third axis is automatically chosen to form a right-handed coordinate system. See above for common combinations.
Target
Either Armature or Object. With "Armature" you get (drumroll...) an animated armature. When you choose "Object", for each joint you get an animated Empty. In this case, the hierarchy is still maintained by object parenting.
Scale
The joint locations (hierarchy) and translations (animation data) are scaled by this factor. For example, if the file is in centimetres and your Blend file uses 1 unit = 1 metre, use scale = 0.01
Start frame
The frame at which the animation should start
Scale FPS
When disabled, the frame rate of the BVH is ignored, and each frame in the BVH file is mapped to a frame in Blender, producing a 1:1 mapping of BVH frames to Blender frames. When enabled, the BVH file's frame rate is used to map each frame in the BVH to the correct time in Blender, producing a 1:1 mapping of BVH time to Blender time.
Update scene framerate
When enabled, it sets the Blender scene frame rate to the BVH file's frame rate. When disabled, the scene's frame rate is left untouched.
Update scene duration
When enabled, the Blender scene is extended so that the BVH file fits in its entirety. The scene is never shortened.
Loop
When enabled, marks all imported F-curves as cyclic, causing the animation to loop indefinitely.
Rotation
Rotation mode for the bones in the armature.

Exporter

The exporter always exports in Blender's coordinate system, meaning up=Z and forward=Y.

Scale
The joint locations (hierarchy) and translations (animation data) are scaled by this factor. For example, if the file should be in centimetres and your Blend file uses 1 unit = 1 metre, use scale = 100
Start and End Frame
Allows you to control which part of the animation is saved to BVH.
Rotation
rotation order of the bones in the BVH file.
Root translation only
When disabled, all joints are saved as 6-DOF translating and rotation joints. When enabled, only the root is saved as 6-DOF, and the other joints are saved as 3-DOF rotating joints.

Known Limitations

  • The BVH format doesn't store the bone roll or end-points. For single chains this is not normally an issue, but when bones have multiple children the importer places the bone tip at the children median location.
    So while the rig can be imported and exported - the exact location of bones in the rig wont be maintained exactly.