This command is used by Maya to handle compatibility issues between file format versions by providing a mechanism to describe differences between two versions. Plug-in writers can make use of this command to handle attribute compatibility changes to files.The first optional command argument argument is a node name and the second optional command argument is an attribute name.Warning:Only use this command to describe changes in names or attributes of nodes that youhave written as plugins. Do notuse this command to change information about builtin dependency graph nodes. Removing attributes on a plug-in node is a special case. Use a separate attrCompatibility call with pluginNode flag and name so that these attributes can be tracked even though the plug-in may not be loaded.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addAttr (a) | bool | ||
|
|||
clear (clr) | bool | ||
|
|||
dumpTable (dmp) | bool | ||
|
|||
enable (e) | bool | ||
|
|||
nodeRename (nr) | unicode | ||
|
|||
pluginNode (pn) | unicode | ||
Registers the string argument as a plug-in node type. This is necessary for subsequent attrCompatibility calls that reference node attributes of unloaded plug- ins. Specifically, this works in the case when attributes are being removed.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
removeAttr (rm) | bool | ||
|
|||
renameAttr (r) | unicode | ||
|
|||
type (typ) | unicode | ||
|
|||
version (v) | unicode | ||
|
Derived from mel command maya.cmds.attrCompatibility
Example:
import pymel.core as pm
# Rename '.x' attributes in old files to '.tx' for all nodes
# of type 'transform'
#
pm.attrCompatibility( 'transform', 'x', r='tx' )
# Rename the old 'group' node to the new 'transform' node
#
pm.attrCompatibility( 'group', nr='transform' )
# This will cause all subsequent attrCompatibility calls to translate
# files from older versions to version 1.0.
#
pm.attrCompatibility( v='1.0' )