Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.

Synopsis

exportEdits([editCommand=string], [excludeHierarchy=boolean], [excludeNode=string], [exportSelected=boolean], [force=boolean], [includeAnimation=boolean], [includeConstraints=boolean], [includeDeformers=boolean], [includeNetwork=boolean], [includeNode=string], [includeSetAttrs=boolean], [includeSetDrivenKeys=boolean], [includeShaders=boolean], [onReferenceNode=string], [selected=boolean], [type=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

exportEdits is NOT undoable, queryable, and NOT editable.

Use this command to export edits made in the scene to a file. The exported file can be subsequently imported to another scene. Edits may include: nodes, connections and reference edits such as value changes. The nodes that are included in the exported file will be based on the options used. At least one option flag that describes the set of target nodes to include in the exported file must be specified (e.g. 'selected', 'onReferenceNode'). Use the inclusion flags ('includeAnimation', 'includeShaders', 'includeNetwork') to specify which additional related nodes will be added to the export list. In export mode, when the command completes successfully, the name of the exported file will be returned. In query mode, this command will return information about the contents of the exported file. The query mode will return the list of nodes that will be considered for inclusion in the exported file based on the specified flags.

Return value

string[]For query execution.

In query mode, return type is based on queried flag.

Keywords

reference, export, node, import

Related

file, referenceEdit, referenceQuery

Flags

editCommand, excludeHierarchy, excludeNode, exportSelected, force, includeAnimation, includeConstraints, includeDeformers, includeNetwork, includeNode, includeSetAttrs, includeSetDrivenKeys, includeShaders, onReferenceNode, selected, type
Long name (short name) Argument types Properties
excludeHierarchy(ehr) boolean createquery
By default, all DAG parents and DAG history are written to the export file. To prevent any DAG relations not otherwise connected to the target nodes to be included, specify the -excludeHierarchy flag.
excludeNode(en) string createquerymultiuse
Prevent the node from being included in the list of nodes being exported. This flag is useful to exclude specific scene nodes that might otherwise be exported. In the case where more than one Maya node has the same name, the DAG path can be specified to uniquely identify the node.
exportSelected(exs) boolean createquery
The selected nodes and their connections to each other will be exported. Additionally, any dangling connections to non-exported nodes will be exported. Default nodes are ignored and never exported. Note that when using the exportSelected flag, only selected nodes are exported, and -include/-exclude flags such as -includeHierarchy are ignored.
force(f) boolean createquery
Force the export action to take place. This flag is required to overwrite an existing file.
includeAnimation(ian) boolean createquery
Additionally include animation nodes and animation helper nodes associated with the target nodes being exported.
includeConstraints(ic) boolean createquery
Additionally include constraint-related nodes associated with the target nodes being exported.
includeDeformers(idf) boolean createquery
Additionally include deformer networks associated with the target nodes being exported.
includeNetwork(inw) boolean createquery
Additionally include the network of nodes connected to the target nodes being exported.
includeNode(includeNode) string createquerymultiuse
Additionally include the named node in the list of nodes being exported. In the case where more than one Maya node has the same name, the DAG path can be specified to uniquely identify the node.
includeSetAttrs(isa) boolean createquery
When using the -selected/-sel flag, if any of the selected nodes are referenced, also include/exclude any setAttr edits on those nodes. If used with the -onReferenceNode/-orn flag, include/exclude any setAttr edits on the reference.
includeSetDrivenKeys(sdk) boolean createquery
Additionally include setDrivenKey-related nodes associated with the target nodes being exported.
includeShaders(ish) boolean createquery
Additionally include shaders associated with the target nodes being exported.
selected(sel) boolean createquery
Export will operate on the list of nodes currently selected. This flag differs from the exportSelected flag in that the selected nodes are not exported, only the edits on them, and any nodes found via the include flags that are used (such as includeAnimation, includeNetwork and so on).
type(typ) string createquery
Set the type of the exported file. Valid values are "editMA" or "editMB". Note that this command respects the global "defaultExtensions" setting for file naming that is controlled with the file command defaultExtensions option. See the file command for more information.
editCommand(ec) string createquerymultiuse
This is a secondary flag used to indicate which type of reference edits should be considered by the command. If this flag is not specified all edit types will be included. This flag requires a string parameter. Valid values are: "addAttr", "connectAttr", "deleteAttr", "disconnectAttr", "parent", "setAttr", "lock" and "unlock". In some contexts, this flag may be specified more than once to specify multiple edit types to consider.
onReferenceNode(orn) string createquerymultiuse
This is a secondary flag used to indicate that only those edits which are stored on the indicated reference node should be considered. This flag only supports multiple uses when specified with the "exportEdits" command.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds


# query nodes to be exported, target is selected nodes, include related shaders
nodeList = cmds.exportEdits(query=1,selected=1,includeShaders=1)

# exported selected nodes and related animation nodes to file
cmds.exportEdits("myExportFile.ma",type='editMA',selected=1,includeShaders=1)
# Result: C:/Documents and Settings/user/My Documents/maya/projects/default/scenes/myExportFile.editMA