The 3dsMax 2009 built-in documentation refers to a file called "bvh.rtf" which, the documentation implies, is on the 3dsMax release DVD or hidden somewhere in your 3dsMax directory structure. I managed to track down a copy of what seems to be the most recent (early 2009) version of this file, so I'll put it here for reference. This file describes in detail what the joint structure of a BVH file needs to look like for 3dsMax Biped import to work with it.
The information below is from Autodesk, not cgspeed.com, and I provide it here simply as a courtesy to Max and BVH users.
- Bruce
___________________________________________________________________________
CS/MAX8 BVH File Format Specification
Character Studio for MAX8 has many new enhancements for BVH import:
1)Support for up to 7 spine links.
The naming convention is: Chest, Chest2, Chest3, Chest4, Chest5, Chest6, Chest7
“Chest” is the first link at the base of the pelvis.
2)Support for optional finger data. The fingers may have up to 3 links each (0,1,2), and the naming convention is as follows (with Finger0 representing the thumb across to Finger4 that represents the pinky finger):
Link 0 Link1 Link 2 -------- ------- --------- Right Thumb: RightFinger0, RightFinger01, RightFinger02, Right Finger1: RightFinger1, RightFinger11, RightFinger12, Right Finger2: RightFinger2, RightFinger21, RightFinger22, Right Finger3: RightFinger3, RightFinger31, RightFinger32, Right Finger4: RightFinger4, RightFinger41, RightFinger42,
Left Thumb: LeftFinger0, LeftFinger01, LeftFinger02, Left Finger1: LeftFinger1, LeftFinger11, LeftFinger12, Left Finger2: LeftFinger2, LeftFinger21, LeftFinger22 Left Finger3: LeftFinger3, LeftFinger31, LeftFinger32 Left Finger4: LeftFinger4, LeftFinger41, LeftFinger42
3)Support for optional bending toes:
The naming convention is: RightToe and LeftToe
4)Support for independent neck motion data
Unlike previous versions, the neck rotations are correctly imported onto the biped figure.
General Information Biped provides direct input of BVH files from disk, including comprehensive key-frame reduction and footstep extraction to provide a fast and accurate means of import for large volumes of rotational data stored in the BVH format.
Biped uses rotational data stored in the BVH format to pose a Biped character on a frame-by-frame basis and to move it forward in time. During import, XYZ Euler joint rotations stored in the BVH file are used to derive Quaternion bone rotation data for the biped at each frame.
Once imported, BVH-based animations can be saved out as native Biped .bip files, providing access to a comprehensive set of animation, layered editing, retargeting and structural modification features that are built directly into Biped.
Overview of BVH-supported Hierarchy and Naming
Biped supports a specific BVH hierarchy and naming scheme, as generated by BioVision Motion Capture Studios. This specific hierarchy allows for automatic mapping of BVH data to the Biped character.
Parsing order of sibling nodes in the hierarchy is arbitrary. That is, the order of sibling nodes can be altered as long as their parent-child relationships do not change.
The supported hierarchy and required node/bone names are listed below. Note that an a lternative naming scheme for some nodes is shown in (). The {} notation is used to clarify the parent-child hierarchy between nodes.
Hips { LeftHip (LeftUpLeg) { LeftKnee (LeftLowLeg) { LeftAnkle (LeftFoot) { End Site {} } } }
RightHip (RightUpLeg) { RightKnee (RightLowLeg) { RightAnkle (RightFoot) { End Site {} } } }
Chest { LeftCollar { LeftShoulder (LeftUpArm) { LeftElbow (LeftLowArm) { LeftWrist (LeftHand) { End Site {} } } } }
RightCollar { RightShoulder (RightUpArm) { RightElbow (RightLowArm) { RightWrist (RightHand) { End Site {} } } } }
Neck { Head { End Site {} } } } }
Character Studio Marker Name File (MNM)
The Character Studio Marker Name file is generally used to match custom marker names in the CSM file with Biped preset list of known, supported marker names. When importing bvh motion capture files, the mnm file can also be used to specify an alternative naming scheme for Biped's fixed hierarchy supported joints (as listed above).
The general syntax of the MNM file consists of two columns of names.
The left column corresponds to Biped's known BVH joint names.
The column on the right corresponds to the custom joint names stored in a specific BVH file.
There should be an entry for every custom BVH joint name in the BVH file. For completeness, all BVH joints can be listed and correlated to internal Biped names, even if the names are identical.
The listing below is an "identity" listing of fixed versus custom joint name (the columns on the left and right are identical).
Optional (missing) marker name entries not in the BVH file can be omitted from the MNM marker file.
This list can be easily copied and modified (via the right column) for each unique motion capture session sample. New CS/MAX8 supported bones are highlighted in bold.
Hips
LeftHip lfemur LeftKnee ltibia LeftAnkle lfoot LeftToe ltoe
RightHip rfemur RightKnee rtibia RightAnkle rfoot RightToe rtoe
Chest upperback Chest2 thorax Chest3 spine_bone3 Chest4 spine_bone4 . . . Chest7 spine_bone7
LeftCollar lshoulderjoint LeftShoulder lhumerus LeftElbow lradius LeftWrist lwrist
LeftFinger0 lThumb_0Bone LeftFinger01 lThumb_1Bone LeftFinger02 lThumb_2Bone
LeftFinger1 lfinger1_0Bone LeftFinger11 lfinger1_1Bone LeftFinger12 lfinger1_2Bone . . . LeftFinger4 lfinger4_0Bone LeftFinger41 lfinger4_1Bone LeftFinger42 lfinger4_2Bone
RightCollar rshoulderjoint RightShoulder rhumerus RightElbow rradius RightWrist rwrist
RightFinger0 rThumb_0Bone RightFinger01 rThumb_1Bone RightFinger02 rThumb_2Bone
RightFinger1 rfinger1_0Bone RightFinger11 rfinger1_1Bone RightFinger12 rfinger1_2Bone . . . RightFinger4 rfinger4_0Bone RightFinger41 rfinger4_1Bone RightFinger42 rfinger4_2Bone
head head neck neck
Establishing a Correct Neutral Pose In creating a BVH file that can be read into Character Studio Biped and displayed correctly, it is critical that the effective neutral pose of the BVH match Biped's neutral pose. That is, the hierarchy, bone lengths, and initial rotations specified in the HIERARCCHY section of the BVH file must create a figure that matches the default pose of a newly-created Biped figure. The initial pose for Biped places the biped figure upright along the +Z axis, facing "forward" along the -Y axis, left hand on the +X axis. Hands are oriented with palms against the outside thighs, with thumb on the forward side; fingers and thumb of each hand outstretched (open) facing "down" along the -Z axis. Legs are together and straight at the knees.
A correctly oriented BVH file can be verified by setting all rotational values in the first frame of the MOTION section to zeroes. When all joint rotation values are set to zero for the first frame of the BVH file, the results displayed at frame zero in Biped, after import, should match the default position of the Biped exactly.
General BVH File Structure The BVH file is divided into two major sections: HIERARCHY and MOTION.
The HIERARCHY section describes the joint-to-joint connections and offsets for the sampled motion data.
The MOTION section describes the movement of these individual joints on a per-sample basis.
CHANNELS information listed within a specific node of the HIERARCHY section signals the existence of corresponding XYZ data streams in the MOTION section which follows. CHANNELS information represents the bulk of the BVH file data.
In the MOTION section, each row contains data values for all CHANNELS which were specified in the HIERARCHY. Each successive row contains a single time sample for all CHANNELS. The listing order of CHANNELS values in each row in the MOTION section is implicitly assumed to match their listed order from the HIERARCHY section (top down).
All string names must appear exactly as shown below, with the exception of nodes names (e.g. LeftHip, LeftKnee, etc) for which alternative naming schemes have been listed above.
CHANNELS data that corresponds to unrecognized JOINT names will be ignored.
The [] notation indicates values or strings that should be used in the actual file.
---------------------------- File Starts Here --------------------- HIERARCHY ROOT Hips { OFFSET [x_float] [y_float] [z_float] CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation JOINT LeftHip { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftKnee { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftAnkle { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET [x_float] [y_float] [z_float] } } } } JOINT RightHip { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightKnee { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightAnkle { OFFSET [x_float] [y_float] [z_float] CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET [x_float] [y_float] [z_float] } } } } JOINT Chest { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftCollar { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftShoulder { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftElbow { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftWrist { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET [x_float y_float z_float] } } } } } JOINT RightCollar { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightShoulder { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightElbow { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightWrist { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET [x_float y_float z_float] } } } } } JOINT Neck { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation JOINT Head { OFFSET [x_float y_float z_float] CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET [x_float y_float z_float] } } } } }
MOTION Frames: [number_of_time_samples_to_follow] Frame Time: [0.033333]
[samp1_chan1_float] [samp1_chan2_float] ... [samp1_chanN_float] [samp2_chan1_float] [samp2_chan2_float] ... [samp2_chanN_float] ... [sampN_chan1_float] [sampN_chan2_float] ... [sampN_chanN_float]
------------ end of file ----------------------------------
Example Biped-supported BVH File with 3 independent spine links, toes, and fingers
-----to test: cut here and paste into “test.bvh” file------------------------ HIERARCHY ROOT Hips { OFFSET 0.355103 3.94642 -0.808935 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation JOINT Chest { OFFSET 0 0.113126 -0.0348888 CHANNELS 3 Zrotation Xrotation Yrotation JOINT Chest2 { OFFSET 0 0.612861 0.000119536 CHANNELS 3 Zrotation Xrotation Yrotation JOINT Chest3 { OFFSET 0 0.462725 -0.000241021 CHANNELS 3 Zrotation Xrotation Yrotation JOINT Neck { OFFSET 0 0.777749 -0.0738766 CHANNELS 3 Zrotation Xrotation Yrotation JOINT Head { OFFSET 0 0.367648 0.0876601 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 0 0.745028 0.147526 } } } JOINT LeftCollar { OFFSET 0.156441 0.698731 -0.0440271 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftUpArm { OFFSET 0.372121 -0.135441 0 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftLowArm { OFFSET 0.637882 -0.767829 -0.0108791 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftHand { OFFSET 0.584657 -0.703957 0.0313351 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftFinger0 { OFFSET 0.0406017 -0.101629 0.146634 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftFinger01 { OFFSET 0.0456647 -0.14047 0.110699 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 0.0553814 -0.113069 0.0336022 } } } JOINT LeftFinger1 { OFFSET 0.250233 -0.250471 0.124973 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftFinger11 { OFFSET 0.0819137 -0.105314 0.0107667 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 0.028819 -0.124616 0.00914457 } } } JOINT LeftFinger2 { OFFSET 0.257071 -0.258304 -0.0439469 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftFinger21 { OFFSET 0.0653642 -0.130915 0.00458132 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 0.00283215 -0.146002 0.00347374 } } } } } } } JOINT RightCollar { OFFSET -0.156439 0.698732 -0.0440276 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightUpArm { OFFSET -0.372121 -0.13544 0 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightLowArm { OFFSET -0.637885 -0.767827 -0.0108808 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightHand { OFFSET -0.584659 -0.703956 0.0313335 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightFinger0 { OFFSET -0.0406021 -0.101629 0.146634 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightFinger01 { OFFSET -0.0456653 -0.14047 0.110699 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET -0.0553819 -0.113069 0.0336021 } } } JOINT RightFinger1 { OFFSET -0.250233 -0.250471 0.124972 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightFinger11 { OFFSET -0.081914 -0.105313 0.0107665 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET -0.0288194 -0.124616 0.00914448 } } } JOINT RightFinger2 { OFFSET -0.257071 -0.258303 -0.0439476 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightFinger21 { OFFSET -0.0653643 -0.130915 0.00458113 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET -0.00283254 -0.146002 0.00347371 } } } } } } } } } } JOINT LeftHip { OFFSET 0.366705 0 0 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftLowLeg { OFFSET -0.0516087 -1.73613 -0.0200994 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftFoot { OFFSET -0.0454942 -1.5773 -0.111522 CHANNELS 3 Zrotation Xrotation Yrotation JOINT LeftToe { OFFSET 0.0265494 -0.371667 0.383426 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 0.0216431 0 0.312564 } } } } } JOINT RightHip { OFFSET -0.366705 0 0 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightLowLeg { OFFSET 0.0516041 -1.73613 -0.0200993 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightFoot { OFFSET 0.0454903 -1.5773 -0.111522 CHANNELS 3 Zrotation Xrotation Yrotation JOINT RightToe { OFFSET -0.0265514 -0.371667 0.383426 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET -0.021644 0 0.312564 } } } } } } MOTION Frames: 4 Frame Time: 0.0333333 0.186767 3.91862 -0.443967 -0.882252 1.84828 -1.64638 0.0659705 0.161547 -0.297068 0.0851066 0.258282 -0.475434 0.106243 0.32265 -0.594412 1.02206 -2.08568 0.37822 2.02006 -4.15309 0.907096 20.9573 1.52272 4.69015 23.7097 -10.0718 5.07481 4.19437 -6.9713 -1.4365 -9.04738 4.50705 3.96434 5.07193 6.97702 8.69036 -5.59548 -13.2114 -8.70983 -26.9741 4.06586 2.18869 -36.5562 2.50153 -1.52111 -14.8409 0.424898 -0.337248 -37.081 1.08577 -0.563483 -20.5514 -0.943333 3.96504 -28.0064 -7.36905 -7.48025 -4.45858 -10.4609 -3.57536 2.66011 5.5298 -4.70457 -21.8438 -14.1597 -13.113 7.12214 -15.9554 10.8377 24.2152 2.87098 -1.21089 34.2697 2.32153 1.47545 13.6045 0.389237 0.316215 35.1744 1.02332 0.552501 10.3939 -2.65556 1.5291 0.384103 0.965636 5.33499 -8.35851 0.912035 0.63068 -0.00326704 0.0471816 9.36283e-007 -6.55988 -2.62101 -4.41285 -0.484818 1.42671 -6.75701 6.41962 0.954417 -0.479308 -0.0635083 -0.917054 -0.000500319 0.185259 3.91844 -0.443769 -0.909038 1.9051 -1.63335 0.0698739 0.169003 -0.308446 0.0919596 0.270174 -0.493674 0.114814 0.337487 -0.617228 0.933323 -2.1512 0.375639 1.84266 -4.28632 0.890751 20.7859 1.47879 4.57826 24.3971 -9.21427 4.74322 4.5923 -3.8843 -6.17871 -13.7096 4.61051 4.19751 1.64758 8.34833 7.16695 -5.50287 -13.0356 -8.57835 -22.6987 4.00248 2.15185 -28.0452 1.84 -1.31521 -10.4381 0.299197 -0.25876 -28.2755 0.798346 -0.495584 -20.7318 -1.00668 4.14057 -28.0753 -7.72909 -8.35309 -4.43778 -8.50148 -0.0829734 4.50999 6.5029 -5.65706 -20.6273 -12.5854 -12.5456 6.70966 -15.241 10.2696 23.5121 2.84881 -1.21929 32.8677 2.21171 1.44393 12.881 0.368428 0.303533 33.7272 0.975695 0.542809 10.4449 -2.70049 1.57912 0.379237 0.948679 5.26743 -8.34136 0.931725 0.630188 -0.00480122 0.0693378 2.30427e-006 -6.51384 -2.6449 -4.43749 -0.48451 1.3824 -6.76411 6.45626 0.959172 -0.482331 -0.0617148 -0.891161 -0.000472244 0.18378 3.91826 -0.442936 -0.943707 2.00496 -1.61155 0.0767651 0.154166 -0.331402 0.101772 0.246375 -0.530435 0.127068 0.307692 -0.663179 0.86168 -2.17526 0.41929 1.6957 -4.33503 0.967533 20.7207 1.47345 4.57063 25.0001 -9.11527 5.14494 5.27656 -1.24288 -11.0096 -18.8196 5.0239 4.83549 -1.40115 9.74054 5.90934 -5.28589 -12.6195 -8.26909 -17.5893 3.92339 2.11418 -17.873 1.10002 -0.944228 -5.15526 0.156881 -0.152204 -17.7105 0.472246 0.357323 -20.9599 -1.14225 4.53045 -28.1119 -7.69388 -9.10778 -4.69874 -5.67933 4.59475 6.47075 6.92324 -6.16068 -17.9969 -10.2858 -11.1127 6.0675 -14.0895 9.37527 21.4053 2.78306 -1.24609 28.6669 1.88773 1.33355 10.7163 0.307148 0.264031 29.3979 0.834875 0.506676 10.52 -2.77796 1.76478 0.367458 0.935521 5.09504 -8.3907 0.909251 0.633092 -0.00579624 0.0837076 3.50867e-006 -6.44586 -2.70615 -4.36519 -0.490749 1.34725 -6.86903 6.42257 0.956543 -0.479598 -0.0603795 -0.871882 -0.000451867 0.182163 3.91827 -0.441332 -0.97265 2.14377 -1.5594 0.0783924 0.125946 -0.329994 0.103288 0.201219 -0.528198 0.128956 0.251244 -0.66036 0.81425 -2.19708 0.426293 1.60012 -4.37963 0.974826 20.7647 1.45991 4.5227 25.3242 -9.60225 5.95316 6.07586 0.613846 -15.1723 -22.431 5.64043 5.7521 -4.20675 11.8436 5.5206 -4.75266 -11.5696 -7.50178 -13.2057 3.85309 2.0876 -9.14296 0.525782 -0.525905 -0.615962 0.0428758 -0.0505077 -8.63247 0.216326 -0.192413 -21.1502 -1.18742 4.64377 -28.172 -7.64815 -9.61196 -5.32879 -2.75455 9.76647 8.56034 7.72017 -7.07087 -14.2266 -7.60985 -9.0033 5.8317 -13.6541 9.04365 18.4778 2.69341 -1.2873 22.8296 1.45274 1.14141 7.70314 0.224427 0.205257 23.372 0.644253 0.438918 10.5907 -2.88858 1.88129 0.358622 0.908691 4.97038 -8.42551 0.898283 0.635345 -0.00481386 0.0695204 2.31801e-006 -6.37896 -2.79166 -4.28458 -0.498999 1.31693 -7.00317 6.37356 0.936778 -0.475203 -0.0624271 -0.901444 -0.000483296
-----end cut here----------------
GENERAL NOTES ABOUT GETTING PRECISE BVH CONVERSION OF LIMBS --------------------------------------------------------------- BIPED has built in anthropomorphic constraints that require that:
* Elbows and Knees are one degree-of-freedom hinge joints. The axis of rotation of the hinge should ideally always be perpendicular to the arm's shoulder-elblow-wrist triangle and the leg's hip-knee-ankle triangle. Therefore, its ideal if the BVH Euler angles for the leg and arm bones match this orientation constraint with no added twists or deviations.
If the hinge joint constraint is violated, BIPED's converter must decide whether to satisfy the orientation data or satisfy the elbow/knee positioning based solely on the point locations.
In the Mocap Conversion Parameters Dialogue Box:
If the "Angle" radio button is specified, the limb's triangle attempts to match the hinge to the Euler matrix axes. This may deviate from the position posture. If the "Point" radio button is specified, the limb's triangle matches the positions of the actual points. This may deviate from the specified Euler angle matrix.
However, in both cases, the limb always moves to hit the IK position of the wrist or ankle, so if Euler angles are given that are not aligned with the natural hinge joint, the axis is projected to nearest axis that satisfies the wrist/ankle IK constraint (that is, one axis must be normal to the line joining the arm's shoulder-wrist or the leg's hip-ankle).
|