Breadcrumbs

Converting Output via the Command Line

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

SGX Maya Plugin Commands

The plugin has three commands:

sgx_load_character

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

MEL:

sgx_load_character -c character_file [-n target_namespace]

Python:

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

Options:

-c ARG

The path of the character file.

-n ARG

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

sgx_import

Imports a single event file as keyframed animation on the character rig.

MEL:

sgx_import -i event_file [-a]

Python:

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

Options:

-i ARG

The event to import.

-a

Import audio.

sgx_export

Converts a batch of event files into selected formats. You also have the option of using Mayabatch to do the export headless.  

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:

-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. See Input.

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

-a

Export audio

-b

Bake animation from controls to deformers (joints, blendshapes, etc.).

-s

Only export selected elements of the scene.

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