Go to: Synopsis. Return value. Keywords. Flags. MEL examples.

Synopsis

assembly [-active string] [-canCreate string] [-createOptionBoxProc script] [-createRepresentation string] [-defaultType string] [-deleteRepresentation string] [-deregister string] [-input string] [-isAType string] [-isTrackingMemberEdits string] [-label string] [-listRepTypes] [-listRepTypesProc script] [-listRepresentations] [-listTypes] [-name string] [-postCreateUIProc script] [-proc script] [-repLabel string] [-repNamespace string] [-repPostCreateUIProc string] [-repPreCreateUIProc string] [-repType string] [-repTypeLabel string] [-repTypeLabelProc script] [-type string]

assembly is undoable, queryable, and editable.

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.

Registering a new assembly type

When defining a new type of assembly derived from the assembly node base class, a number of procedures can be defined through the assembly command to properly integrate the new assembly node type into Maya. Most of these procedures are used to integrate the assembly type with the Maya user interface, and are not required for non-interactive scripting use. For more information, see the MPxAssembly class description in the Maya API documentation. Some of the important procedures that can be registered through the assembly command are the following:
listRepTypesProc
Procedure to list the representation types that the new assembly type can create. This allows Maya to query representation types that can be created by an assembly without actually creating an assembly node.
repTypeLabelProc
Procedure to return a (possibly localized) label which is shown in the user interface for the representation types the assembly can create. The label should be a short, user-friendly, readable description of the representation type.
createOptionBoxProc
Procedure to populate an option box for creation options for the assembly type. If defined, this procedure will populate an option box that is available for creation of that assembly's type.
repPreCreateUIProc
Procedure to provide a dialog before representation creation. If defined, will be invoked by Maya so that the user can interactively make choices before the creation of a type of representation for the assembly.
postCreateUIProc
Procedure to provide a dialog after assembly creation. If defined, will be invoked by Maya so that the user can interactively make choices and apply them to the assembly after its creation.

Return value

None

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

Keywords

representation, assembly

Flags

active, canCreate, createOptionBoxProc, createRepresentation, defaultType, deleteRepresentation, deregister, input, isAType, isTrackingMemberEdits, label, listRepTypes, listRepTypesProc, listRepresentations, listTypes, name, postCreateUIProc, proc, repLabel, repNamespace, repPostCreateUIProc, repPreCreateUIProc, repType, repTypeLabel, repTypeLabelProc, type
Long name (short name) Argument types Properties
-active(-a) string queryedit
Set or query the active representation for a specific assembly.
-canCreate(-cc) string query
Query the representation types the specific assembly can create.
-createOptionBoxProc(-cob) script queryedit
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) string edit
Create and add a specific type of representation for an assembly. Notice that "input" flag must be used with this flag.
-defaultType(-dt) string queryedit
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) string edit
Delete a specific representation from an assembly.
-deregister(-d) string edit
Deregister a registered assembly type. If the deregistered type is the default type, the default type will be set to the empty string.
-input(-in) string edit
Specify the additional parameters of representation creation procedure when creating a representation. This flag must be used with createRepresentation flag.
-isAType(-isa) string query
Query whether the given object is of an assembly type.
-isTrackingMemberEdits(-ite) string query
Query whether the given object is tracking member edits.
-label(-lbl) string queryedit
Set or query the label for an assembly type. Assembly type is specified with flag "type". If no type specified, the default type is used.
-listRepresentations(-lr) query
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.
-listRepTypes(-lrt) query
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 queryedit
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.
-listTypes(-lt) query
Query the supported assembly types.
-name(-n) string create
Specify the name of the assembly when creating it.
-repNamespace(-rns) string query
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) string queryedit
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.

In query mode, this flag needs a value.

-repPreCreateUIProc(-pec) string queryedit
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.

In query mode, this flag needs a value.

-proc(-prc) script edit
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.
-postCreateUIProc(-aoc) script queryedit
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.
-repLabel(-rl) string query
Query the label of the representation that is the argument to this flag, for a given assembly.

In query mode, this flag needs a value.

-repType(-rt) string query
Specify a representation type to use as a filter for the -listRepresentations query. The representation type is the argument to this flag.

In query mode, this flag needs a value.

-repTypeLabel(-rtl) string query
Query the label of the specific representation type.

In query mode, this flag needs a value.

-repTypeLabelProc(-rtp) script queryedit
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) string createqueryedit
Set or query properties for the specified registered assembly type.

In query mode, this flag needs a value.


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 be used more than once in a command.

MEL examples

//Create a default type of assembly and name it MyAssembly.
//The assembly name is optional.
//
assembly -name "MyAssembly";
//Create an assembly of type MyAssemblyType and name it MyAssembly.
//
assembly -name "MyAssembly" -type "MyAssemblyType"
//Set the default type to be MyAssemblyType.
//
assembly -edit -defaultType MyAssemblyType;
//Set the procedure that provides the representation type label for
//an assembly type.
//
assembly -edit -repTypeLabelProc "MyRepTypeLabelQuery" -type "MyAssembly";
//Set the label for the default assembly type.
//
assembly -edit -label "My Assembly Type";
//Set the procedure that provides the representation type list which the
//default assembly supports.
//
assembly -edit -listRepTypesProc "MyRepTypesProc";
//Set the pre-create UI procedure for a representation type, for a
//specific type of assembly.
//
assembly -edit -repPreCreateUIProc MyRepresentation -proc "MyPreCreateProcedure" -type "MyAssembly";
//Set the post-create UI procedure for a representation type, for the
//default assembly type.
//
assembly -edit -repPostCreateUIProc MyRepresentation -proc "MyPostCreateProcedure";