Maya API 2.0 MObject handle validity after graph changes
0 reputation · 08 May 2023, 02:24 UTC
Goal
Determine whether a cached Maya Python API 2.0 MObject or MPlug handle remains valid after dependency-graph operations such as undo, node deletion, or node creation.
Constraints
Autodesk guidance indicates that handles should be reacquired after graph-modifying operations, but it does not clearly document a public API call to test whether an existing handle still references live graph memory before use. Handle-staleness guarantees may differ between Maya API 1.0, API 2.0, and releases, so any verification must be version-specific.
Is there a supported Maya API 2.0 method to verify that an existing MObject handle is still live before accessing it?
If no public liveness check exists, what is the supported approach for safely reusing cached handles across undo or deletion boundaries?