ragdoll-maya icon indicating copy to clipboard operation
ragdoll-maya copied to clipboard

Exception in ragdoll.commands breaks undo

Open domrab opened this issue 3 years ago • 3 comments

from ragdoll import commands as ragCmds

# calling with wrong arguments/types to cause exception
group = ragCmds.create_group("test")

Trying to undo in maya results in: // Error: line 1: Undo is temporarily unavailable. Try exiting the current tool. //

Calling cmds.undoInfo(closeChunk=True) seems to solve the issue.

Is this a bug or is it deliberately left to the TDs to validate their inputs?

domrab avatar Jul 25 '22 19:07 domrab

To expand, AssertionErrors are not affected by this and do NOT break undo

domrab avatar Jul 25 '22 19:07 domrab

Upon further testing, this might not be related to commands but to exceptions raised within the cmdx.DagModifier?

domrab avatar Jul 25 '22 19:07 domrab

Yes, I believe you are right. It shouldn't happen, the modifiers are explicitly protected against this here:

https://github.com/mottosso/ragdoll/blob/b959b76b2984c405c60be22ea24549e6b0d9cea4/ragdoll/vendor/cmdx_ragdoll.py#L5776

But I have also seen this. It is not deliberate and could be considered a bug. Happy to accept a PR if you manage to find a solution.

mottosso avatar Jul 25 '22 19:07 mottosso