Command to register assemblies for the scene assembly framework, to create them, and to edit and query them. Assembly nodes are DAG nodes, and are therefore shown in the various DAG editors (Outliner, Hypergraph, Node Editor). At assembly creation time, the node name defaults to the node type name. The assembly command can create any node that is derived from the assembly node base class. It also acts as a registry of these types, so that various scripting callbacks can be defined and registered with the assembly command. These callbacks are invoked by Maya during operations on assembly nodes, and can be used to customize behavior. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
active (a) | unicode | ||
Set the active representation by name, or query the name of the active representation. Edit mode can be applied to more than one assembly. Query mode will return a single string when only a single assembly is specified, and will return an array of strings when multiple assemblies are specified. Using an empty string as name means to inactivate the currently active representation. |
|||
activeLabel (al) | unicode | ||
Set the active representation by label, or query the label of the active representation. Edit mode can be applied to more than one assembly. Query mode will return a single string when only a single assembly is specified, and will return an array of strings when multiple assemblies are specified. |
|||
canCreate (cc) | unicode | ||
|
|||
createOptionBoxProc (cob) | script | ||
Set or query the option box menu procedure for a specific assembly type. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
createRepresentation (cr) | unicode | ||
|
|||
defaultType (dt) | unicode | ||
Set or query the default type of assembly. When the assembly command is used to perform an operation on an assembly type rather than on an assembly object, it will be performed on the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
deleteRepresentation (dr) | unicode | ||
|
|||
deregister (d) | unicode | ||
|
|||
input (input) | unicode | ||
|
|||
isAType (isa) | unicode | ||
|
|||
isTrackingMemberEdits (ite) | unicode | ||
|
|||
label (lbl) | unicode | ||
|
|||
listRepTypes (lrt) | bool | ||
Query the supported representation types for a given assembly type. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
listRepTypesProc (lrp) | script | ||
Set or query the procedure that provides the representation type list which an assembly type supports. This procedure takes no argument, and returns a string array of representation types that represents the full set of representation types this assembly type can create. The assembly type for which this procedure applies will be the default type, unless the type flag is used to specify an explicit assembly type. |
|||
listRepresentations (lr) | bool | ||
Query the created representations list for a specific assembly. The -repType flag can be used to filter the list and return representations for a single representation type. If the -repType flag is not used, all created representations will be returned. |
|||
listTypes (lt) | bool | ||
|
|||
name (n) | unicode | ||
|
|||
newRepLabel (nrl) | unicode | ||
|
|||
postCreateUIProc (aoc) | script | ||
Set or query the UI post-creation procedure for a given assembly type. This procedure will be invoked by Maya immediately after an assembly of the specified type is created from the UI, but not through scripting. It can be used to invoke a dialog, to obtain and set initial parameters on a newly-created assembly. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
proc (prc) | script | ||
Specify the procedure when setting the representation UI post- or pre-creation procedure, for a given assembly type. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
renameRepresentation (rnr) | unicode | ||
|
|||
repLabel (rl) | unicode | ||
Query or edit the label of the representation that is the argument to this flag, for a given assembly. In both query and edit modes, the -repLabel flag specifies the name of the representation. In edit mode, the -newRepLabel flag must be used to specify the new representation label. |
|||
repName (rnm) | unicode | ||
Specify the representation name to set on representation creation or rename. This flag is optional with the createRepresentation flag: if omitted, the assembly will name the representation. It is mandatory with the renameRepresentation flag. |
|||
repNamespace (rns) | unicode | ||
Query the representation namespace of this assembly node. The value returned is used by Maya for creating the namespace where nodes created by the activation of a representation will be added. If a name clash occurs when the namespace is added to its parent namespace, Maya will update repNamespace with the new name. Two namespaces are involved when dealing with an assembly node: the namespace of the assembly node itself (which this flag does not affect or query), and the namespace of its representations. The representation namespace is a child of its assembly node’s namespace. The assembly node’s namespace is set by its containing assembly, if it is nested, or by the top-level file. Either the assembly node’s namespace, or the representation namespace, or both, can be the empty string. It should be noted that if the assembly node is nested, the assembly node’s namespace will be (by virtue of its nesting) the representation namespace of its containing assembly. |
|||
repPostCreateUIProc (poc) | unicode | ||
Set or query the UI post-creation procedure for a specific representation type, and for a specific assembly type. This procedure takes two arguments, the first the DAG path to the assembly, and the second the name of the representation. It returns no value. It will be invoked by Maya immediately after a representation of the specified type is created from the UI, but not through scripting. It can be used to invoke a dialog, to obtain and set initial parameters on a newly-created representation. The representation type is the argument of this flag. The -proc flag must be used to specify the procedure name. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
repPreCreateUIProc (pec) | unicode | ||
Set or query the UI pre-creation procedure for a specific representation type, and for a specific assembly type. This procedure takes no argument, and returns a string that is passed as an argument to the -input flag when Maya invokes the assembly command with the -createRepresentation flag. The representation pre- creation procedure is invoked by Maya immediately before creating a representation of the specified type from the UI, but not through scripting. It can be used to invoke a dialog, to obtain the creation argument for a new representation. The representation type is the argument of this flag. The -proc flag must be used to specify the procedure name. The assembly type will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
repType (rt) | unicode | ||
|
|||
repTypeLabel (rtl) | unicode | ||
|
|||
repTypeLabelProc (rtp) | script | ||
Set or query the procedure that provides the representation type label, for a given assembly type. The procedure takes the representation type as its sole argument, and returns a localized representation type label. The assembly type for which this procedure applies will be the default type, unless the -type flag is used to specify an explicit assembly type. |
|||
type (typ) | unicode | ||
Set or query properties for the specified registered assembly type. Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
Derived from mel command maya.cmds.assembly
Example:
import pymel.core as pm
#Create a default type of assembly and name it MyAssembly.
#The assembly name is optional.
#
pm.assembly(name='MyAssembly')
# Result: nt.AssemblyDefinition(u'MyAssembly') #
#Create an assembly of type MyAssemblyType and name it MyAssembly.
#
pm.assembly(name='MyAssembly', type='MyAssemblyType')
#Set the default type to be MyAssemblyType.
#
pm.assembly(edit=True, defaultType='MyAssemblyType')
#Create a representation of type "MyRepType", on assembly myAssembly, and
#name it "MyRepName"
#
pm.assembly(myAssembly, edit=True, createRepresentation='MyRepType',
repName='MyRepName')
#Rename representation "MyRepName" to "MyNewRepName" on assembly myAssembly.
#
pm.assembly(myAssembly, edit=True, renameRepresentation='MyRepName',
repName='MyNewRepName')
#Set the procedure that provides the representation type label for
#an assembly type.
#
pm.assembly(edit=True, repTypeLabelProc='MyRepTypeLabelQuery', type='MyAssembly')
#Set the label for the default assembly type.
#
pm.assembly(edit=True, label='My Assembly Type')
#Set the procedure that provides the representation type list which the
#default assembly supports.
#
pm.assembly(edit=True, listRepTypesProc='MyRepTypesProc')
#Set the pre-create UI procedure for a representation type, for a
#specific type of assembly.
#
pm.assembly(edit=True, repPreCreateUIProc='MyRepresentation', proc='MyPreCreateProcedure', type='MyAssembly')
#Set the post-create UI procedure for a representation type, for the
#default assembly type.
#
pm.assembly(edit=True, repPostCreateUIProc='MyRepresentation', proc='MyPostCreateProcedure' )