Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undo cause crash the maya, when use the OpenMaya.MDagModifier().deleteNode()

0 REPLIES 0
Reply
Message 1 of 1
subing85
111 Views, 0 Replies

Undo cause crash the maya, when use the OpenMaya.MDagModifier().deleteNode()

Undo cause crash the maya (Maya-2020 and Maya-2022), when use the OpenMaya.MDagModifier().deleteNode(), but cmds.delete(node) work prefect (no maya crash while doing undo).

This the source code to reproduce undo crash issue.

In Maya Create one Polygon sphere, run the below code, and try to do undo.

If any one face same issue previously or find the solution, that is appreciable.

 

 

from maya import OpenMaya
node = "pSphere1"
mselection = OpenMaya.MSelectionList()
mselection.add(node)
mobject = OpenMaya.MObject()
mselection.getDependNode(0, mobject)
handle = OpenMaya.MObjectHandle(mobject)
print ("Before delete", handle.isAlive())
mod = OpenMaya.MDagModifier()
mod.deleteNode(mobject)
mod.doIt()
del mod
print ("After delete", handle.isAlive())

 

Labels (3)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums