Use Python commands to export and import XGen files

 
 
 

You can use Python commands to save and load XGen Collection, Description, delta, and Modifier files. Python commands can be executed in Maya or from a Python session.

To save and load XGen files using the XGen Window menu options, see Save and load XGen files.

See also XGen files.

Collection file

In the XGen Python API, Collections are called palettes.

Create a Collection (.xgen) file using exportPalette.

xg.eportPalette(string palette, string fileName)

palette - name of the palette file to export
fileName - name for the .xgen file to create

Import a Collection file using importPalette.

xg.importPalette(string palette, string deltas[], string nameSpace="")

palette - name of the palette file to import
deltas - list of optional delta files to also apply during import
nameSpace - optional nameSpace to apply to the imported palette

See

Delta file

To create a delta (.xgd) file, use createDelta.

xg.createDelta(string palette, string newDelta)
palette - name of the palette to create delta for
newDelta - name for the delta file

You can apply the delta file at the same time you import the Collection, but you can also apply the delta file individually. To apply only the delta file, use the applyDelta command.

xg.applyDelta(string palette, string delta)

palette - name of palette to apply delta file to
delta - name of delta file

Description file

To create Description (.xdsc) files, use exportDescription.

xg.exportDescription(string palette, string description, string fileName, bool guides=false)

palette - name of palette containing description
description - name of description to export
fileName - name of description file to create guides
flag - for future use to signal guide transfer (not used)

Before importing a Description you must have an existing Collection. To import a Description, use the importDescription.

xg.importDescription(string palette, string fileName)

palette - name of palette to import description into
fileName - name of description file to import

Modifier file

In the XGen Python API, Modifiers are called FX modules.

To save an Modifier (.xgfx) file, use the Python exportFXModule command:

xg.exportFXModule(string palette, string description, string name, string fileName)

palette - name of palette holding the fx module
description - name of the description holding the fx module
name - name of the fx module to export
fileName - name of the fx module file to create

To import the Modifier file, use the importFXModule python command:

xg.importFXModule(string palette, string description, string fileName)
palette - name of palette to import into
description - name of description to import fx module into
fileName - name of fx module file to import

Related topics

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License