Returns a new plug for the given attribute of the given node.
Sequence Support
We explicitly do not support indexing because that is conditional on the plug being an array of plugs, which is not always the case, and due to potential confusion over logical versus physical index. Thus it is better handled through the elementByLogicalIndex() and elementByPhysicalIndex() methods.
Returns an array of plugs which are connected to this one. If asDest is True connections in which this plug is the destination will be included in the array. If asSrc is True connections in which this plug is the source will be included in the array.
OpenMaya.MPlug.connectionByPhysicalIndex
(
)
Returns a plug for the index'th connected element of this plug.
If this plug is a source, return the destination plugs connected to it.
If this plug is not a source, a null plug is returned.
This method will produce the networked version of the connected plug.
OpenMaya.MPlug.destinationsWithConversions
(
)
If this plug is a source, return the destination plugs connected to it.
This method is very similar to the destinations() method. The only difference is that the destinations() method skips over any unit conversion node connected to this source, and returns the destination of the unit conversion node.
destinationsWithConversionNode() does not skip over unit conversion nodes, and returns the destination plug on a unit conversion node, if present.
Note that the behavior of connectedTo() is identical to destinationsWithConversions(), that is, do not skip over unit conversion nodes.
OpenMaya.MPlug.destructHandle
(
)
Destroys a data handle previously constructed using constructHandle().
Like numElements() but evaluates all connected elements first to ensure that they are included in the count. Raises a TypeError if the plug is not a plug array.
OpenMaya.MPlug.getExistingArrayAttributeIndices
(
)
Returns an array of all the plug's logical indices which are currently in use.
Returns the number of this plug's elements which have connections. Raises a TypeError if the plug is not an array of plugs.
OpenMaya.MPlug.numElements
(
)
Returns the number of the plug's logical indices which are currently in use. Connected elements which have not yet been evaluated may not yet fully exist and may be excluded from the count.
Returns the number of the plug's logical indices which are currently in use. Connected elements which have not yet been evaluated may not yet fully exist and may be excluded from the count. Raises a TypeError if the plug is not a plug array.
Changes the logical index of the specified attribute in the plug's path. Raises a TypeError if the current plug is networked. or if attribute is not an array.
OpenMaya.MPlug.setAttribute
(
)
Switches the plug to reference the given attribute of the same node as the previously referenced attribute.
Pre-allocates space for count elements in an array of plugs.
Signature:
setNumElements(count)
Parameters:
count - int
Returns:
Reference to self
Description:
Pre-allocates space for count elements in an array of plugs. Raises a TypeError if the plug is not a plug array or if it already has elements.
OpenMaya.MPlug.setShort
(
)
Sets the plug's value as a short integer.
Signature:
setShort(value)
Parameters:
value - int
Returns:
Reference to self
Description:
Sets the plug's value as a short integer.
OpenMaya.MPlug.setString
(
)
Sets the plug's value as a string.
Signature:
setString(value)
Parameters:
value - string
Returns:
Reference to self
Description:
Sets the plug's value as a string.
OpenMaya.MPlug.source
(
)
If this plug is a destination, return the source plug connected to it.
If this plug is not a destination, a null plug is returned.
This method will produce the networked version of the connectedplug.
OpenMaya.MPlug.sourceWithConversion
(
)
If this plug is a destination, return the source plug connected to it.
This method is very similar to the source() method. The only difference is that the source() method skips over any unit conversionnode connected to this destination, and returns the source of the unit conversion node.
sourceWithConversion() does not skip over unitconversion nodes, and returns the source plug on a unit conversionnode, if present.
Note that the behavior of connectedTo() is identical to sourceWithConversion(), that is, do not skip over unit conversion nodes.
Member Data Documentation
OpenMaya.MPlug.kAll = 0
static
Name:
kAll
Type:
int
Description:
All values.
OpenMaya.MPlug.kChanged = 2
static
Name:
kChanged
Type:
int
Description:
Values which have changed.
OpenMaya.MPlug.kChildrenNotFreeToChange = 2
static
Name:
kChildrenNotFreeToChange
Type:
int
Description:
Some of the child plugs are not free to change.
OpenMaya.MPlug.kFreeToChange = 0
static
Name:
kFreeToChange
Type:
int
Description:
All tested plugs are free to change.
OpenMaya.MPlug.kLastAttrSelector = 3
static
Name:
kLastAttrSelector
Type:
int
Description:
End of list. Used for counting.
OpenMaya.MPlug.kNonDefault = 1
static
Name:
kNonDefault
Type:
int
Description:
Values not at their defaults.
OpenMaya.MPlug.kNotFreeToChange = 1
static
Name:
kNotFreeToChange
Type:
int
Description:
Some tested plugs are not free to change.
Property Documentation
OpenMaya.MPlug.info
static
Description of the plug for debugging purposes, in the form node:attr1.attr2[].attr3...
Name:
info
Type:
string
Access:
R
Description:
Description of the plug for debugging purposes, in the form node:attr1.attr2[].attr3...
OpenMaya.MPlug.isArray
static
True if plug is an array of plugs.
Name:
isArray
Type:
bool
Access:
R
Description:
True if plug is an array of plugs.
OpenMaya.MPlug.isCaching
static
True if plug's value is being cached.
Name:
isCaching
Type:
bool
Access:
RW
Description:
True if plug's value is being cached.
OpenMaya.MPlug.isChannelBox
static
True if plug will appear in Maya's Channel Box.
Name:
isChannelBox
Type:
bool
Access:
RW
Description:
True if plug will appear in Maya's Channel Box.
OpenMaya.MPlug.isChild
static
True if plug is a child of a compound parent.
Name:
isChild
Type:
bool
Access:
R
Description:
True if plug is a child of a compound parent.
OpenMaya.MPlug.isCompound
static
True if plug is compound parent with children.
Name:
isCompound
Type:
bool
Access:
R
Description:
True if plug is compound parent with children.
OpenMaya.MPlug.isConnected
static
True if plug has any connections.
Name:
isConnected
Type:
bool
Access:
R
Description:
True if plug has any connections.
OpenMaya.MPlug.isDestination
static
True if plug is the destination of a connection.
Name:
isDestination
Type:
bool
Access:
R
Description:
True if plug is the destination of a connection.
OpenMaya.MPlug.isDynamic
static
True if plug is for a dynamic attribute.
Name:
isDynamic
Type:
bool
Access:
R
Description:
True if plug is dynamic.
OpenMaya.MPlug.isElement
static
True if plug is an element of an array of plugs.
Name:
isElement
Type:
bool
Access:
R
Description:
True if plug is an element of an array of plugs.
OpenMaya.MPlug.isFromReferencedFile
static
True if plug is part of a connection from a referenced file.
Name:
isFromReferencedFile
Type:
bool
Access:
R
Description:
True if plug is part of a connection from a referenced file.
OpenMaya.MPlug.isIgnoredWhenRendering
static
True if connetions to plug are ignored during rendering.
Name:
isIgnoredWhenRendering
Type:
bool
Access:
R
Description:
True if connections to plug are ignored during rendering.