My Project
Classes | Public Types | Public Member Functions | List of all members
ParaEngine::CBVHSerializer Class Reference

BioVision Hierarchy (BVH) motion capture file serializer for ParaX file. More...

#include <BVHSerializer.h>

Classes

struct  BoneChildCountCompare
 
struct  BoneMarkerCompare
 
struct  MotionCaptureNode
 
struct  UniBone
 

Public Types

enum  BVH_NODES {
  Hips = 0, LeftHip, LeftKnee, LeftAnkle,
  LeftToe, RightHip, RightKnee, RightAnkle,
  RightToe, Chest, Chest2, Chest3,
  Chest4, Chest5, Chest6, Chest7,
  LeftCollar, LeftShoulder, LeftElbow, LeftWrist,
  LeftFinger0, LeftFinger01, LeftFinger02, LeftFinger1,
  LeftFinger11, LeftFinger12, LeftFinger4, LeftFinger41,
  LeftFinger42, RightCollar, RightShoulder, RightElbow,
  RightWrist, RightFinger0, RightFinger01, RightFinger02,
  RightFinger1, RightFinger11, RightFinger12, RightFinger4,
  RightFinger41, RightFinger42, Head, Neck,
  MAX_BVH_NODE
}
 
enum  CharacterStudioNodeEnum {
  C7 =0, CLAV, LANK, LBHD,
  LBWT, LELB, LFHD, LFIN,
  LFWT, LKNE, LMT5, LSHO,
  LTOE, LWRE, LWRI, RANK,
  RBHD, RBWT, RELB, RFHD,
  RFIN, RFWT, RKNE, RMT5,
  RSHO, RTOE, RWRE, RWRI,
  STRN, T10
}
 predefined CSM file node. More...
 
enum  UniversalNodeEnum {
  UN_Root, UN_Root1, UN_Root2, UN_Spine0,
  UN_Left_Thigh, UN_Left_Calf, UN_Right_Thigh, UN_Right_Calf,
  UN_Spine1, UN_Spine2, UN_Spine3, UN_Spine4,
  UN_Neck, UN_Head, UN_Left_Clavicle, UN_Left_UpperArm,
  UN_Right_Clavicle, UN_Right_UpperArm
}
 

Public Member Functions

void SaveCSM (const string &sFileName)
 not implemented. More...
 
bool InitHierachy (CParaXModel &xmesh)
 must call this function before save to any of the supported file format it will read the bone hierarchy of the animated mesh in to some intermediary structure. More...
 
bool SaveBVH (const string &sFileName, const string &sMarkerNameFile)
 save to BioVision Hierarchy file. More...
 

Detailed Description

BioVision Hierarchy (BVH) motion capture file serializer for ParaX file.

it can also export as CSM (character studio model format), which is a much simpler one. Usage: call InitHierachy() and then call SaveBVH(). in order to use the exported BVH file. First create a biped in 3dsmax 8 or above, then load the BVH file, save the animation as bip file. open or create your character, load the .bip file to the biped of your character. And it is done, 3dsmax will automatically fit the animation in .bip file with your character bone structure. please see SaveBVH() for more information.

Member Enumeration Documentation

§ CharacterStudioNodeEnum

predefined CSM file node.

Member Function Documentation

§ InitHierachy()

bool CBVHSerializer::InitHierachy ( CParaXModel xmesh)

must call this function before save to any of the supported file format it will read the bone hierarchy of the animated mesh in to some intermediary structure.

Parameters
xmesh
Returns

§ SaveBVH()

bool CBVHSerializer::SaveBVH ( const string &  sFileName,
const string &  sMarkerNameFile 
)

save to BioVision Hierarchy file.

InitHierachy() must be called before this function is called. if the marker file is not generated, it will generate and return without exporting animations, this gives the user the chance to manually examine the maker file. When this function is called a second time, the serializer will be able to locate an existing marker file, and it will generate all animations with the marked bones.

Parameters
sFileNameoutput BVH file name
sMarkerNameFileif this is blank, a default marker name file will be saved in "sFileName.marker" if it does not exist. however if the default marker exists, it will be used. When generating the default marker file, the serializer automatically generate BVH marker position. But it does not guarantee that the data is correct, the user should manually check the marker file. if sMarkerNameFile is a valid marker file, BVH file will use this marker file and will not generate new ones or use default ones.
Remarks
: at least the "Hips" marker should be present in the marker file, in order for animation to be generated. however, all known marker position must be present in order to be used by 3dsmax. Please see the BVH.rtf document in the 3dsmax CD.
: marker file format: it is really simple format. Each line denote a bone that begins with its ID. When a maker file is automatically generated, just append any of the known marker name in front of each line. such as
Hips 16: ChildCount 2 SubBones 8 SubLevel 4 vAbsPos(0.1 0.6 0.0) BoneLength:0.61
RightHip 19: ChildCount 1 SubBones 3 SubLevel 3 vAbsPos(0.1 0.6 -0.1) BoneLength:0.12
RightKnee 34: ChildCount 1 SubBones 2 SubLevel 2 vAbsPos(0.1 0.3 -0.1) BoneLength:0.25
: currently we support all traditional BVH nodes, as well as those supported by 3dsmax 8, such as Chest2, LeftToe, LeftFinger0, etc. we also allow the position of Hips and Chest node to be arbitrary in mesh bone hirarchy. i.e. the chest bone can be the parent or sibling of the Hips bones.

§ SaveCSM()

void ParaEngine::CBVHSerializer::SaveCSM ( const string &  sFileName)

not implemented.

because i have no idea where the marker point should be.


The documentation for this class was generated from the following files: