Convert Model
The convert_model example demonstrates how to convert a character model and its associated animation file between FBX and GLB formats. Use the -m or --model option to specify the input model, followed by the path to the model file (.fbx, .glb, .gltf, or .urdf). If no input model is provided, the tool will automatically read the animation from an existing GLB or FBX file.
convert_model [OPTIONS]
Options:
-h,--help Print this help message and exit
-m,--model TEXT:FILE Input model (.fbx/.glb/.gltf/.urdf); not required if reading animation from glb or fbx
-p,--parameters TEXT:FILE Input model parameter file (.model)
-l,--locator TEXT:FILE Input locator file (.locators)
-d,--motion TEXT:FILE Input motion data file (.glb/.fbx)
-o,--out TEXT REQUIRED Output file (.fbx/.glb/.gltf)
--out-locators-local TEXT Output a locator file (.locators) in local space for transferring between identities
--out-locators-global TEXT Output a locator file (.locators) in global space for authoring a template
--out-parameters TEXT Output a model parameter file (.model) containing the parameter transform and limits
--save-markers Save marker data from input motion file in the output
-c,--character-mesh (FBX Output file only) Saves the Character Mesh to the output file.
- Example 1: Convert an fbx model to a glb model.
pixi run convert_model -m character.fbx -p character.model -l character.locators -o character.glb
- Example 2: Convert a glb file to an fbx file with animation curves only (without mesh).
pixi run convert_model -d animation.glb -o animation.fbx
- Example 3: Convert an fbx animation to glb with a given model parameter file. There is no guarantee the conversion is lossless. We will simply use InverseParameterTransform for a least square fit of the parameters.
pixi run convert_model -d animation.fbx -p character.model -o animation.glb
- Example 4: Apply animation from an s0 model to a s4 model for high-res rendering (ie. with mesh). The
.modelfile is needed if the target model is in.fbxformat so we know how to map the input motion.
pixi run convert_model -m character.fbx -p character.model -d animation_s0.glb -o animation_s4.fbx -c