Creating Blue Mars .chr (character) files
From Blue Mars Developer Guidebook
Contents |
Introduction
bmImport and bmImportCmd support two (2) types of Blue Mars .chr (character) files: Skeleton with Skin and Morph Targets.
- Skeleton with Skin
- A skeleton with skin is generally used to build an articulated body, using an underlying skeleton consisting of linked nodes (bones), and an enveloping skin geometry object. The skin geometry object is deformed by the skeleton according to a set of bone weights applied to each vertex in the skin geometry object.
- A biped skeleton with skin is a special-case character model, with a specific naming convention, generally used to build a human (or human-like) body.
- Morph Targets
- Morph targets are generally used to build a human (or human-like) head, using a neutral-position base geometry object, with a set of topologically-identical morph target geometry objects. The position of each vertex in the rendered geometry object is determined by interpolating between the vertex's position in the base geometry object and the vertex's position in the morph target geometry objects.
In Blue Mars .chr (character) files, there can only be one (1) geometry object per file (excluding the morph target geometry objects). The geometry object can be the skin geometry object of a skeleton with skin, and/or the base geometry object of a set of morph targets.
If multiple geometry objects exist in the Maya or 3ds Max file, such as a body object used as the skin geometry object of a skeleton with skin and a separate head object used as the base geometry object of a set of morph targets, then each object will need to be exported into a COLLADA .dae file and processed separately by bmImport or bmImportCmd. This can be accomplished by either (a) separating the original objects into multiple Maya or 3ds Max files, or (b) by specifically selecting the objects to be exported by ColladaMaya or ColladaMax.
Skeleton with Skin
Only one (1) skeleton and one (1) skin geometry object can be exported per COLLADA .dae file, to be processed by bmImport or bmImportCmd.
There should be only one (1) root node for the skeleton, which must either be a skeleton bone/joint, and/or be specifically named Bip01. Note that a skeleton which is under a non-bone/joint root node, with a name other than Bip01, or in a file with multiple root nodes, will not be recognized as a skeleton, unless the Skeleton root node: option (in bmImport) or the -skeleton option (in bmImportCmd) is used to identify the specific skeleton root node.
For biped skeletons, the root skeleton node should be named Bip01 and the child skeleton nodes (bones) should be prefixed with Bip01 (for example, "Bip01 Neck" or "Bip01_L_Foot"). This naming convention is not strictly required, if the skeleton is being used merely to pose pose a static model.
Special nodes, which are not actually part of the body skeleton, such as those used to determine an eye look-at point or to attach game objects to the character, can be attached to the skeleton nodes and should not use the Bip01 prefix. For example, "eye_left_bone" or "weaponPos_hurricane".
Helper nodes, which are not to be included in the list of bones, can be attached to skeleton nodes, if they are prefixed with the underscore '_' or dollar-sign '$' character (for example, "$Bip01 R Finger0Nub" or "_Bip01_HeadNub").
Skeleton with skin models should have a minimum of one (1) hit detection object, linked to a node (bone) in the skeleton. bmImportCmd will issue a warning if no hit detection object exists. Note: In the case where a skeleton is being used merely to pose a static model, a hit detection object is usually not required.
Hit Detection Objects
The CryEngine2 Exporter plug-in for 3ds Max creates the hit detection objects automatically from the geometry objects used to represent the bones in the 3ds Max user interface. The materials applied to these bone objects are used to determine which part of the character's body have been hit. Unfortunately, when using the ColladaMaya and the ColladaMax plug-ins, the bone objects cannot be exported into the COLLADA .dae file.
bmImport and bmImportCmd replace the original CryEngine2 Exporter mechanism by the use of HitMesh objects, which need to be built and linked to the nodes (bones) in the skeleton. The name of the HitMesh object must be the same as the name of the node (bone) to which it is linked, postfixed with the string _HitMesh. Examples of valid HitMesh object names include "Bip01 Spine1_HitMesh", and "Bip01_L_Forearm_HitMesh". Each HitMesh object should have an assigned material which corresponds to the applicable body region for the hit detection, ex. a material named "Skel_Arm_RightProxy" may be applied to HitMesh objects for the right forearm, "Bip01_R_Forearm_HitMesh", and right upperarm, "Bip01_R_UpperArm_HitMesh", of the body.
Note: A skeleton with skin model, without a HitMesh object can be exported and processed by bmImport or bmImportCmd. However, the resulting .chr file may occasionally crash the Resource Compiler and the Sandbox2 editor.
Morph Targets
Only one (1) morphed model, which includes its base geometry object and associated morph target geometry objects, can be exported per COLLADA .dae file, to be processed by bmImport or bmImportCmd.
Morph targets, such as head models, are usually attached to a biped skeleton with skin model in the Sandbox2 editor. To make this work correctly, it is necessary to include the subset of the skeleton used in the biped skeleton with skin model, to which the morph target models are linked. The hierarchy of the skeleton nodes must match exactly to the biped skeleton with skin and the number of skeleton nodes cannot exceed the number of skeleton nodes in the biped skeleton with skin.
Morph targets in Blue Mars .chr files are optimized, such that only the vertices which have changed in the morph target geometry object are saved. The difference in the position of the vertex in the base geometry object and the position of the vertex in the morph target geometry object is compared against a minimum offset value. If the difference in position is less than the minimum offset value, then the vertex is considered to have the same position in the base and morph target geometry objects and is omitted. The minimum offset value can be set in bmImportCmd via the -morphTargetMinOffset option, or in bmImport via the Morph target minimum offset: edit field. By default, this value is set to 0.0001.
Exporting from Maya
Skeleton with Skin
Using the Outliner or the Hypergraph, select the skeleton root node/joint, and the skin geometry object.
Morph Targets
Using the Outliner or the Hypergraph, select the skeleton root node/joint, and the blend shape object.
Using ColladaMaya
Select File -> Export Selection....
Click on Options... to open the Export Options window and set the various options as shown below:

Click on Export Selection or Apply.
Set Files of type to "COLLADA exporter (*.dae,*.xml)". When typing in the filename, do not forget to include the .dae extension.

Exporting from 3ds Max
Skeleton and Skin
Using the Schematic View, expand and select all of the nodes for the skeleton, including the HitMesh objects, and the skin geometry object. Selecting only the root node will not export the special bones and Hitmesh objects.
Note: The ColladaMax NextGen exporter does not currently work properly with the File -> Export Selected... option. If there are multiple skin geometry objects in the scene (ex. LOD geometries), all objects will be exporter to the COLLADA .dae file, not just the selected object. It is necessary to use the Layer control to explicitly hide all of the objects, except for the specific skin geometry to be exported with the skeleton.
Morph Targets
Using the Schematic View, select the skeleton root node/joint and the base object for the morph targets.
Using ColladaMax
Select File -> Export Selected....
Set Save as type to "COLLADA (*.DAE)". When typing in the filename, do not forget to include the .dae extension.

After you click Save, the Export Options window will open. Set the options as shown below:

Limitations and Known Bugs
- Phys skeletons and IK parameters cannot be exported.
- Only polygonal geometry is supported. NURBS surfaces are not supported.
- bmImport and bmImportCmd will automatically triangulate polygonal geometry; however, the built-in triangularization, while computationally accurate, may introduce undesirable changes in the appearance of the model. In addition, the built-in triangularization may generate additional triangles and exceed the polygon count limit of the Resource Compiler (see below). Thus, it is strongly recommended that the 3D artist perform the triangularization in Maya or 3DS Max, and evaluate the results on the model prior to export.
- A single object cannot have more than 65,535 vertices, normals, faces, polygons, et cetera. bmImport and bmImportCmd can process the object, but the resulting file may not be compatible with the Resource Compiler or the Sandbox2 editor.
Copyright © 2008-2009 Avatar Reality, Inc.
