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

Synopsis

instanceable([allow=boolean], [recursive=boolean], [shape=boolean])

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

instanceable is undoable, queryable, and NOT editable.

Flags one or more DAG nodes so that they can (or cannot) be instanced. This command sets an internal state on the specified DAG nodes which is checked whenever Maya attempts an instancing operation. If no node names are provided on the command line then the current selection list is used.

Sets are automatically expanded to their constituent objects. Nodes which are already instanced (or have children which are already instanced) cannot be marked as non-instancable.

Return value

boolean[]For query execution.

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

Keywords

node, dependency, graph, instancing

Related

duplicate, group, instance, parent, rename, setAttr

Flags

allow, recursive, shape
Long name (short name) Argument types Properties
allow(a) boolean createquery
Specifies the new instanceable state for the node. Specify true to allow the node to be instanceable, and false to prevent it from being instanced. The default is true (i.e. nodes can be instanced by default).
recursive(r) boolean create
Can be specified with the -allow flag in create or edit mode to recursively apply the -allow setting to all non-shape children of the selected node(s). To also affect shapes, also specify the -shape flag along with -recursive.
shape(s) boolean create
Can be specified with the -allow flag in create or edit mode to apply the -allow setting to all shape children of the selected node(s). This flag can be specified in conjunction with the -recursive flag.

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

# create a sphere.
# flag the transform and its shape as non-instanceable, then try to instance the sphere.
# you get an error because the shape is non-instanceable.
cmds.sphere()
cmds.instanceable( allow=0, shape=True )
cmds.instance()
# Error: '|nurbsSphere1' has non-instanceable children thus it cannot be instanced.
# Flag the sphere and its shape as instanceable. Then it can be instanced.
cmds.instanceable( allow=1, shape=True )
cmds.instance()
# Result: nurbsSphere2 #