Breadcrumbs

Command-line Interface (Maya)

With the SGX Studio Maya plugin, you can use MEL and Python commands to create custom scripts for exporting animation generated by SGX.

The plugin has five commands:

sgx_load_character

Loads the character control file for the target character rig in the scene.

Syntax

MEL:

sgx_load_character -c character_control_file [-n target_namespace]

Python:

Python
cmds.sgx_load_character(c=character_control_file, [n=target_namespace])

Option

Description

-c ARG

The path of the character control file.

-n ARG

The namespace, if any, to which the character control file should be retargeted.

-h

Print help.

sgx_import

Imports a single event file as keyframed animation on the character rig. Equivalent to single import in the plugin GUI. This must be preceded by sgx_load_character.

Syntax

MEL:

sgx_import -i event_file [-a]

Python:

cmds.sgx_import(i=event_file, a={0,1})

Option

Description

-i ARG

The event to import.

-a

Import audio.

-h

Print help.

sgx_export

Converts a batch of event files into desired format(s). Equivalent to batch export in the plugin GUI. This must be preceded by sgx_load_character.

Syntax

MEL:

sgx_export -i input_path -o output_directory -f output_formats [-a] [-b] [-s] [-p playblast_options]

Python:

cmds.sgx_export(i=input_directory, o=output_directory, f=output_formats, a={0,1}, b={0,1}, s={0,1}, p=playblast_options)

Options:

Option

Description

-i ARG

The input path, which may be either: a directory containing the input event files, or a file containing a list of event file paths.

-o ARG

The path of the directory to which the exported output should be saved.

-f ARG

Comma-separated list of export formats including one or more of {maya,fbx,playblast};

-p ARG

Playblast options in a comma-separated list: width,height,format,encoding,camera. (The available video formats and encodings depend on your local environment. For no encoding, use "none" for theencoding value.)

-a

Export audio.

-b

Bake animation from higher-level controls to deformers (joints, blendshapes, etc.). Relevant only for FBX export.

-s

Only export selected elements of the scene.

-h

Print help.

Example

Here is an example of the batch export command using all of the options:

MEL:

sgx_export -i "C:/my_input" -o "C:/my_output" -f "maya,playblast" -a -b -s -p "600,800,avi,none,persp"

Python:

cmds.sgx_export(i="C:/my_input", o="C:/my_output", f="maya,avi", a=1, b=1, s=1, p="600,800,avi,none,persp")

sgx_import_pose

Approximates the current rig pose as a muscle pose, for use in expressions. See Importing expression poses. This must be preceded by sgx_load_character. Typically followed by a call to sgx_add_expression (see below).

Syntax

MEL:

sgx_import_pose

Python:

cmds.sgx_import_pose()

Options:

Option

Description

-h

Print help.

sgx_add_expression

Adds an expression to a particular expression group, using the current muscle pose (see Adding expressions).

Syntax

MEL:

sgx_add_expression -e expression_group

Python:

cmds.sgx_import_pose(e=expression_group)

Options:

Option

Description

-e ARG

The expression group to which to add the new expression, in path format (e.g. /neutral/high).

-h

Print help.

sgx_key_muscle_poses

Keys each muscle pose to the timeline at intervals of 10 frames. The names of the poses and the frame numbers at which they appear are printed to the SGX Studio log. Equivalent to Tools > Key muscle poses in the plugin GUI (see Menu Functions).

Syntax

MEL:

sgx_key_muscle_poses

Python:

cmds.sgx_key_muscle_poses()

sgx_key_expressions

Keys each expression pose in the behavior modes to the timeline at intervals of 10 frames. The expression identifiers and the frame numbers at which they appear are printed to the SGX Studio log. Equivalent to Tools > Key expressions in the plugin GUI (see Menu Functions).

Syntax

MEL:

sgx_key_expressions

Python:

cmds.sgx_key_expressions()

sgx_clear_keys

Clears all keyframes of the animation targets on the timeline. Equivalent to Tools > Clear keys in the plugin GUI (see Menu Functions).

Syntax

MEL:

sgx_clear_keys

Python:

cmds.sgx_clear_keys()

Headless use

All plugin commands may be passed to Maya in headless mode. See Maya’s documentation on running Maya on the command line. Note that any quotes or forward slashes in the command string must be escaped in the command string passed to Maya.