Own methods.
| Method |
Return type |
Purpose |
as_non_networked |
Plug |
Retain the same plug path without a networked proxy before a DG edit. |
is_connected_to |
bool |
Check whether this plug is the exact logical source of the destination. |
is_connected_from |
bool |
Check the exact logical source of this plug. |
has_category |
bool |
Check membership of an attribute category. |
add_category |
None |
Add a category only when missing. |
remove_multi_element |
bool |
Remove an existing multi element; report whether removal occurred. |
get |
Optional[Plug] |
Find a child by name or index; the default fallback is a null plug. |
read |
Any |
Read and convert the current value according to its native type. |
set |
None |
Write a compatible value; reject a plug with an incoming driver. |
set_preserving_lock |
None |
Write the value and restore the affected local lock flags. |
kind |
str |
Describe the type as a readable identifier. |
connect_to |
None |
Connect this plug to one or more destinations. |
connect_from |
None |
Connect a source to this plug. |
disconnect_to |
None |
Disconnect the relationship to the given destinations. |
disconnect_from |
None |
Disconnect the relationship from the given source. |
disconnect_all_inputs |
None |
Disconnect the incoming logical source of this plug. |
disconnect_all_outputs |
None |
Disconnect the outgoing logical destinations of this plug. |
disconnect_all |
None |
Disconnect incoming then outgoing relationships of this plug. |
enum_mapping |
dict[str, int] |
Map each enum label to its integer, including sparse enums. |
as_matrix |
om.MMatrix |
Read the value through the om.MMatrix accessor. |
set_matrix |
None |
Write a value compatible with om.MMatrix. |
as_bool |
bool |
Read the value through the bool accessor. |
set_bool |
None |
Write a value compatible with bool. |
as_char |
int |
Read the value through the int accessor. |
set_char |
None |
Write a value compatible with int. |
as_double |
float |
Read the value through the float accessor. |
set_double |
None |
Write a value compatible with float. |
as_float |
float |
Read the value through the float accessor. |
set_float |
None |
Write a value compatible with float. |
as_int |
int |
Read the value through the int accessor. |
set_int |
None |
Write a value compatible with int. |
as_short |
int |
Read the value through the int accessor. |
set_short |
None |
Write a value compatible with int. |
as_string |
str |
Read the value through the str accessor. |
set_string |
None |
Write a value compatible with str. |
as_mangle |
om.MAngle |
Read the value through the om.MAngle accessor. |
set_mangle |
None |
Write a value compatible with om.MAngle. |
as_mdata_handle |
om.MDataHandle |
Read the value through the om.MDataHandle accessor. |
set_mdata_handle |
None |
Write a value compatible with om.MDataHandle. |
as_mdistance |
om.MDistance |
Read the value through the om.MDistance accessor. |
set_mdistance |
None |
Write a value compatible with om.MDistance. |
as_mobject |
om.MObject |
Read the value through the om.MObject accessor. |
set_mobject |
None |
Write a value compatible with om.MObject. |
as_mpxdata |
om.MPxData |
MPxData accessor unavailable in the tested Maya versions. |
set_mpxdata |
None |
MPxData write unavailable in the tested Maya versions. |
as_mtime |
om.MTime |
Read the value through the om.MTime accessor. |
set_mtime |
None |
Write a value compatible with om.MTime. |
upstream |
PlugArray |
Recursively follow source links between plugs. |
downstream |
PlugArray |
Recursively follow destination links between plugs. |
info |
dict[str, Any] |
Collect names, types, flags, structure and connections in a dictionary. |
read_components |
list[tuple[str, list[int]]] |
Read a compact mesh component list, sorted and deduplicated by kind. |
set_components |
None |
Write vertex, edge or face indices to a componentList. |
plug.as_non_networked()Method
| Returns |
Contract |
Plug |
Same node and attribute identity, child path and logical indices, without a Maya networked proxy. |
Call this before retaining a plug across DG edits, particularly a disconnection: these edits may destroy a Maya networked proxy. Copy construction alone is insufficient. A null or already non-networked plug returns self; a networked plug produces a new wrapper.
The call changes neither values nor connections. Reads remain live and follow renames; this is not a snapshot. It does not repair a stale reference, and the original identity must still exist: protected accesses reject a deleted node or attribute (RuntimeError).
plug.is_connected_to(destination: Union['Plug', om.MPlug])Method
| Parameter |
Type |
Default |
destination |
Union[Plug, om.MPlug] |
required |
| Returns |
Contract |
bool |
Check whether this plug is the exact logical source of the destination. |
These accessors use Maya logical connections: a conversion node may be skipped. Inherited OpenMaya methods sourceWithConversion() and destinationsWithConversions() remain available for exact native edges. A null plug produces False in both is_connected_* tests; a different argument type raises TypeError.
plug.is_connected_from(source: Union['Plug', om.MPlug])Method
| Parameter |
Type |
Default |
source |
Union[Plug, om.MPlug] |
required |
| Returns |
Contract |
bool |
Check the exact logical source of this plug. |
These accessors use Maya logical connections: a conversion node may be skipped. Inherited OpenMaya methods sourceWithConversion() and destinationsWithConversions() remain available for exact native edges. A null plug produces False in both is_connected_* tests; a different argument type raises TypeError.
plug.has_category(category: str)Method
| Parameter |
Type |
Default |
category |
str |
required |
| Returns |
Contract |
bool |
Check membership of an attribute category. |
plug.add_category(category: str)Method
| Parameter |
Type |
Default |
category |
str |
required |
| Returns |
Contract |
None |
Add a category only when missing. |
plug.remove_multi_element(logical_index: Optional[int]=None, *, break_connections: bool=False)Method
| Parameter |
Type |
Default |
logical_index |
Optional[int] |
None |
break_connections |
bool |
False |
| Returns |
Contract |
bool |
Remove an existing multi element; report whether removal occurred. |
On the root, provide logical_index; on an element, omit it. False means the index did not exist. break_connections=False protects connections; True allows them to be broken. Invalid call form or negative index: ValueError. Native failure: RuntimeError.
plug.get(keyname: Union[int, str], default: Optional['Plug']=None)Method
| Parameter |
Type |
Default |
keyname |
Union[int, str] |
required |
default |
Optional[Plug] |
None |
| Returns |
Contract |
Optional[Plug] |
Find a child by name or index; the default fallback is a null plug. |
Use on a compound or multi root. A name searches direct children by long or short name. An integer selects a logical multi index or child position. When absent, a non-null default is returned; otherwise the result is a null Plug, not None. A scalar call may raise TypeError before fallback.
plug.read()Method
| Returns |
Contract |
Any |
Read and convert the current value according to its native type. |
The type depends on the attribute: Python scalar, tuple for a compound, list for a multi, None for message, om.MMatrix for a matrix, om.MAngle/MDistance/MTime for units. Geometry data remains om.MObject. A multi list contains existing element values in physical order: it does not retain their logical indices. A null plug reads as None; deleted identity may raise RuntimeError. Reading a destination returns its evaluated value.
plug.set(value: Any)Method
| Parameter |
Type |
Default |
value |
Any |
required |
| Returns |
Contract |
None |
Write a compatible value; reject a plug with an incoming driver. |
An already connected input is rejected (RuntimeError). An enum accepts its integer or label, with a case-insensitive fallback; an unknown label raises ValueError. Prefer {index: value} for sparse multis: omitted elements are not removed. A compound accepts a sequence or child dictionary. A null plug does nothing. Incompatible types may raise TypeError. Specify units with om.MAngle, om.MDistance and om.MTime.
plug.set_preserving_lock(value: Any)Method
| Parameter |
Type |
Default |
value |
Any |
required |
| Returns |
Contract |
None |
Write the value and restore the affected local lock flags. |
An already connected input is rejected (RuntimeError). An enum accepts its integer or label, with a case-insensitive fallback; an unknown label raises ValueError. Prefer {index: value} for sparse multis: omitted elements are not removed. A compound accepts a sequence or child dictionary. A null plug does nothing. Incompatible types may raise TypeError. Specify units with om.MAngle, om.MDistance and om.MTime. Unlike set(), this method temporarily unlocks the affected plugs and restores their flags through protected cleanup, including after failure. This does not promise rollback of every compound value if a later write fails.
plug.kind()Method
| Returns |
Contract |
str |
Describe the type as a readable identifier. |
plug.connect_to(dest: Union['Plug', om.MPlug, 'PlugArray', om.MPlugArray], force: bool=False)Method
| Parameter |
Type |
Default |
dest |
Union[Plug, om.MPlug, PlugArray, om.MPlugArray] |
required |
force |
bool |
False |
| Returns |
Contract |
None |
Connect this plug to one or more destinations. |
force=False preserves an existing input: if another source occupies the destination, the call may do nothing. force=True replaces it, including an animation connection. An identical connection is skipped. Destination locks are restored. Check the result with is_connected_to() or is_connected_from() when needed.
plug.connect_from(src: Union['Plug', om.MPlug], force: bool=False)Method
| Parameter |
Type |
Default |
src |
Union[Plug, om.MPlug] |
required |
force |
bool |
False |
| Returns |
Contract |
None |
Connect a source to this plug. |
force=False preserves an existing input: if another source occupies the destination, the call may do nothing. force=True replaces it, including an animation connection. An identical connection is skipped. Destination locks are restored. Check the result with is_connected_to() or is_connected_from() when needed.
plug.disconnect_to(dest: Union['Plug', om.MPlug, 'PlugArray', om.MPlugArray])Method
| Parameter |
Type |
Default |
dest |
Union[Plug, om.MPlug, PlugArray, om.MPlugArray] |
required |
| Returns |
Contract |
None |
Disconnect the relationship to the given destinations. |
Only the targeted relationships are removed; an absent relationship does nothing. Destination locks are restored. No conversion node is deleted. These operations alone do not guarantee an entry in Maya’s Undo queue.
plug.disconnect_from(src: Union['Plug', om.MPlug])Method
| Parameter |
Type |
Default |
src |
Union[Plug, om.MPlug] |
required |
| Returns |
Contract |
None |
Disconnect the relationship from the given source. |
Only the targeted relationships are removed; an absent relationship does nothing. Destination locks are restored. No conversion node is deleted. These operations alone do not guarantee an entry in Maya’s Undo queue.
plug.disconnect_all_inputs()Method
| Returns |
Contract |
None |
Disconnect the incoming logical source of this plug. |
Only the targeted relationships are removed; an absent relationship does nothing. Destination locks are restored. No conversion node is deleted. These operations alone do not guarantee an entry in Maya’s Undo queue.
plug.disconnect_all_outputs()Method
| Returns |
Contract |
None |
Disconnect the outgoing logical destinations of this plug. |
Only the targeted relationships are removed; an absent relationship does nothing. Destination locks are restored. No conversion node is deleted. These operations alone do not guarantee an entry in Maya’s Undo queue.
plug.disconnect_all()Method
| Returns |
Contract |
None |
Disconnect incoming then outgoing relationships of this plug. |
Only the targeted relationships are removed; an absent relationship does nothing. Destination locks are restored. No conversion node is deleted. These operations alone do not guarantee an entry in Maya’s Undo queue.
plug.enum_mapping()Method
| Returns |
Contract |
dict[str, int] |
Map each enum label to its integer, including sparse enums. |
Requires an enum (RuntimeError otherwise). Negative values and gaps are retained; do not infer values from label positions.
plug.as_matrix()Method
| Returns |
Contract |
om.MMatrix |
Read the value through the om.MMatrix accessor. |
plug.set_matrix(value: Union[om.MMatrix, om.MTransformationMatrix, list])Method
| Parameter |
Type |
Default |
value |
Union[om.MMatrix, om.MTransformationMatrix, list] |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MMatrix. |
Convert through the matrix adapter and write native data. This shortcut does not use the same incoming-connection guard as set(). For general writing with that guard prefer set(matrix); to preserve locks use set_preserving_lock(matrix).
plug.as_bool()Method
| Returns |
Contract |
bool |
Read the value through the bool accessor. |
plug.set_bool(value: bool)Method
| Parameter |
Type |
Default |
value |
bool |
required |
| Returns |
Contract |
None |
Write a value compatible with bool. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_char()Method
| Returns |
Contract |
int |
Read the value through the int accessor. |
plug.set_char(value: int)Method
| Parameter |
Type |
Default |
value |
int |
required |
| Returns |
Contract |
None |
Write a value compatible with int. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_double()Method
| Returns |
Contract |
float |
Read the value through the float accessor. |
plug.set_double(value: float)Method
| Parameter |
Type |
Default |
value |
float |
required |
| Returns |
Contract |
None |
Write a value compatible with float. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_float()Method
| Returns |
Contract |
float |
Read the value through the float accessor. |
plug.set_float(value: float)Method
| Parameter |
Type |
Default |
value |
float |
required |
| Returns |
Contract |
None |
Write a value compatible with float. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_int()Method
| Returns |
Contract |
int |
Read the value through the int accessor. |
plug.set_int(value: int)Method
| Parameter |
Type |
Default |
value |
int |
required |
| Returns |
Contract |
None |
Write a value compatible with int. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_short()Method
| Returns |
Contract |
int |
Read the value through the int accessor. |
plug.set_short(value: int)Method
| Parameter |
Type |
Default |
value |
int |
required |
| Returns |
Contract |
None |
Write a value compatible with int. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_string()Method
| Returns |
Contract |
str |
Read the value through the str accessor. |
plug.set_string(value: str)Method
| Parameter |
Type |
Default |
value |
str |
required |
| Returns |
Contract |
None |
Write a value compatible with str. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_mangle()Method
| Returns |
Contract |
om.MAngle |
Read the value through the om.MAngle accessor. |
plug.set_mangle(value: Union[om.MAngle, float])Method
| Parameter |
Type |
Default |
value |
Union[om.MAngle, float] |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MAngle. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write. A numeric angle is constructed in radians; an explicit om.MAngle avoids ambiguity.
plug.as_mdata_handle()Method
| Returns |
Contract |
om.MDataHandle |
Read the value through the om.MDataHandle accessor. |
plug.set_mdata_handle(value: om.MDataHandle)Method
| Parameter |
Type |
Default |
value |
om.MDataHandle |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MDataHandle. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_mdistance()Method
| Returns |
Contract |
om.MDistance |
Read the value through the om.MDistance accessor. |
plug.set_mdistance(value: om.MDistance)Method
| Parameter |
Type |
Default |
value |
om.MDistance |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MDistance. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_mobject()Method
| Returns |
Contract |
om.MObject |
Read the value through the om.MObject accessor. |
plug.set_mobject(value: om.MObject)Method
| Parameter |
Type |
Default |
value |
om.MObject |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MObject. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.as_mpxdata()Method
| Returns |
Contract |
om.MPxData |
MPxData accessor unavailable in the tested Maya versions. |
Reproduced limitation in Maya 2025.3 and 2026.3: AttributeError. Both wrappers access om.MPlug.asMPxData, which is absent from this API. The listed type describes the signature’s intent, not a working return value.
plug.set_mpxdata(value: om.MPxData)Method
| Parameter |
Type |
Default |
value |
om.MPxData |
required |
| Returns |
Contract |
None |
MPxData write unavailable in the tested Maya versions. |
Reproduced limitation in Maya 2025.3 and 2026.3: AttributeError. Both wrappers access om.MPlug.asMPxData, which is absent from this API. The listed type describes the signature’s intent, not a working return value.
plug.as_mtime()Method
| Returns |
Contract |
om.MTime |
Read the value through the om.MTime accessor. |
plug.set_mtime(value: om.MTime)Method
| Parameter |
Type |
Default |
value |
om.MTime |
required |
| Returns |
Contract |
None |
Write a value compatible with om.MTime. |
Immediate typed write without automatic unlocking. Connected inputs are rejected (RuntimeError); already equal values are skipped. Use set_preserving_lock() when lock flags must be preserved around a write.
plug.upstream(max_depth: int | None=None, type_filter: Set[int] | None=None)Method
| Parameter |
Type |
Default |
max_depth |
int | None |
None |
type_filter |
Set[int] | None |
None |
| Returns |
Contract |
PlugArray |
Recursively follow source links between plugs. |
Traversal follows plug connections, not internal dependencies between a node’s inputs and outputs. Immediate neighbors are included even with max_depth=0; the limit controls further recursion. type_filter filters results, not traversal.
plug.downstream(max_depth: int | None=None, type_filter: Set[int] | None=None)Method
| Parameter |
Type |
Default |
max_depth |
int | None |
None |
type_filter |
Set[int] | None |
None |
| Returns |
Contract |
PlugArray |
Recursively follow destination links between plugs. |
Traversal follows plug connections, not internal dependencies between a node’s inputs and outputs. Immediate neighbors are included even with max_depth=0; the limit controls further recursion. type_filter filters results, not traversal.
plug.info()Method
| Returns |
Contract |
dict[str, Any] |
Collect names, types, flags, structure and connections in a dictionary. |
On a multi root this call currently encounters the same error as next_free_logical_index. Read the required fields separately when that information is unnecessary.
plug.read_components(*, only_mesh: bool=True)Method
| Parameter |
Type |
Default |
only_mesh |
bool |
True |
| Returns |
Contract |
list[tuple[str, list[int]]] |
Read a compact mesh component list, sorted and deduplicated by kind. |
Returns [] outside componentList. vtx, edge and face entries are merged and sorted. Generic single is treated as vtx; only_mesh=False does not add double/triple-indexed components. This shortcut is therefore not a general component inventory.
plug.set_components(items: Union[dict[str, Iterable[int]], list[tuple[str, Iterable[int]]], list[dict]])Method
| Parameter |
Type |
Default |
items |
Union[dict[str, Iterable[int]], list[tuple[str, Iterable[int]]], list[dict]] |
required |
| Returns |
Contract |
None |
Write vertex, edge or face indices to a componentList. |
Accepts a kind → indices dictionary, a pair list, dictionaries from read(), or a native componentList om.MObject. Unknown kinds are ignored. Only simple mesh components are constructed by the shortcut.