glmExportMotion

glmExportMotion command provides a way to export a motion like the Character Maker does automatically.
DoubleArray glmExportMotion [-outputFile string] [-fromInputMotionFile string] [-fromRoot string] [-characterFile string] [-remapByName boolean] [-firstFrame int] [-lastFrame int] [-conversionFactor float] [-animationInBlindData boolean] [-frequency float] [-deltaPositionX float] [-deltaPositionY float] [-deltaPositionZ float] [-fixLoopingOffset boolean] [-totalDeltaOrientationHeading float] [-movingDirectionX float] [-movingDirectionY float] [-movingDirectionZ float] [-blendFromStartOfMotion] [-firstBlendingFrame int] [-lastBlendingFrame int] [-footprintsOnChannel int] [-automaticFootprints] [-speedThreshold float] [-groundHeightThreshold float] [-footprintsAnimCurveChannel int] [-footprintsAnimCurve string]

Flags

Long name (short name) Argument types Properties Description
-outputFile (-of) string   defines the output file (*.gmo binary or *.gmo.xml ascii)
-fromInputMotionFile (-imf) string   defines the input motion file to modify (*.gmo binary or *.gmo.xml ascii)
-fromRoot (-ro) string   defines the root node used to load the motion from the joint hierarchy
-characterFile (-chf) string   defines the character file containing the Golaem Skeleton
-remapByName (-rbn) boolean   specifies if the bones should be remapped by name rather than by ID
-firstFrame (-ftf) integer   specifies the first frame of the cropped Motion
-lastFrame (-ltf) integer   specifies the last frame of the cropped Motion
-conversionFactor (-cf) float   specifies the conversion factor for the Motion import
-animationInBlindData (-bd) boolean   if source animation should be saved in blind data
-frequency (-frq) float   specifies the frequency of the motion, in frames per second
-deltaPositionX (-dpx) float   specifies the x translation of the Pelvis bone during the motion
-deltaPositionY (-dpy) float   specifies the y translation of the Pelvis bone during the motion
-deltaPositionZ (-dpz) float   specifies the z translation of the Pelvis bone during the motion
-fixLoopingOffset (-flo) boolean   specifies if the pelvis orientation should be fixed for looping
-totalDeltaOrientationHeading (-doh) float   specifies the heading rotation of the Pelvis bone during the motion
-movingDirectionX (hdx) float   specifies the moving direction X axis
-movingDirectionY (hdy) float   specifies the moving direction Y axis
-movingDirectionZ (hdz) float   specifies the moving direction Z axis
-blendFromStartOfMotion (-bfs) boolean   if present blend the motion so that the start frame becomes identical to the end frame. Without this flag the last frame becomes identical to the start frame
-firstBlendingFrame (-fbf) int   specifies the first frame from which to linearly increase or decrease the error between the start frame and end frame of the motion. If the First Frame To Blend and the Last Frame To Blend are identical, no blending is done
-lastBlendingFrame (-lbf) int   specifies the last frame from which to linearly increase or decrease the error between the start frame and end frame of the motion. If the First Frame To Blend and the Last Frame To Blend are identical, no blending is done
-footprintsOnChannel (-foc) string multi-use specifies the Limb bone name on which apply the footprints
-automaticFootprints (-af) boolean   enables the automatic footprint computation if set
-speedThreshold (-st) float   specifies the speed of a Limb's end bone under which a footprint is detected on the Limb in Manual Computation Mode. It enables the manual computation mode if set
-groundHeightThreshold (-ght) float   specifies the height of a Limb's end bone under which a footprint is detected on the Limb in Manual Computation Mode. It enables the manual computation mode if set
-footprintsAnimCurve (-fac)  string multi-use specifies the custom animCurves name to apply. It enables the animation curves computation mode if set
-footprintsAnimCurve (-fac)  string multi-use specifies the custom foot sequence to apply for all limbs. It enables the foot sequence computation mode if set. A foot sequence can be fetched from the glmMotionFileTool command.

Return Value

This command returns an array of 3 values if it's used with the "-fromRoot" option and succeeded, or an int value otherwise (1 for success, 0 for failure).
When it returns an array of 3 values, it corresponds to the mean conversion error on position / orientation / scale (same than the Golaem Conversion Quality in the user interface for motion export)

MEL Examples

// export a motion from a pre-loaded character with custom animCurve
glmExportMotion -outputFile "myMotion.gmo" -fromRoot "Root_Character" -characterFile "mySkeletonFile.gcha" -footprintsOnChannel "LeftFoot" -footprintsAnimCurve "myFirstAnimCurve" -footprintsOnChannel "RightFoot" -footprintsAnimCurve "mySecondAnimCurve" ;
// Result: 1.268263 0.29183 0.0040076 //
 
// modify and export a motion from a input motion file
glmExportMotion -outputFile "myMotion.gmo" -fromInputMotionFile "originalMotion.gmo" -automaticFootprints ;
// Result: 1 //

Python Examples

# export a motion from a pre-loaded character with custom animCurve
cmds.glmExportMotion(outputFile="myMotion.gmo", fromRoot="Root_Character", characterFile="mySkeletonFile.gcha" , footprintsOnChannel=["LeftFoot", "RightFoot"], footprintsAnimCurve=["myFirstAnimCurve", "mySecondAnimCurve"])
// Result: 1.268263 0.29183 0.0040076 //
 
# modify and export a motion from a input motion file
cmds.glmExportMotion(outputFile="myMotion.gmo", fromInputMotionFile="originalMotion.gmo", automaticFootprints=True)
// Result: True //