Skip to main content
Skip table of contents

M9. Command-line Interface

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 three commands:

  • sgx_load_character

  • sgx_import

  • sgx_export

sgx_load_character

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

Syntax

MEL:

NONE
sgx_load_character -c character_control_file [-n target_namespace]

Python:

PY
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.

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:

CODE
sgx_import -i event_file [-a]

Python:

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

Option

Description

-i ARG

The event to import.

-a

Import audio.

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:

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

Python:

CODE
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.

Example

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

MEL:

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

Python:

CODE
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")

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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.