Deleting orient constraints crashes Maya

In an ik/fk snapping tool, I was using, in Python, delete(orientConstraint(obj1, obj2)) to painlessly match up FK controls to IK joint orientations. Visually, everything is fine, but clicking the match button a few times causes Maya to crash. I’ve isolated the deletion of the orient constraint as the problem.
It’s something I’ve experienced in the past.
Our company is still using Maya 2014 (testing 2017 for upgrade soon!). Is this problem related to the version of Maya? Has anyone else experienced this before?
Thanks,
Alec

Well it could certainly be a bug. But if you’ve narrowed it down to the orient constraint, then perhaps you can just try avoiding using that by using xform to orient your object or, since it looks like you are using PyMEL:

targetObject.setRotation(sourceObject.getRotation(space=‘world’), space=‘world’)

Also, as a side note I really recommend putting your PyMEL into a namespace. The original tutorial says importing as * works, but then you end up unable to properly filter and find PyMEL functions. For example, if you use the pm namespace, you can always search “pm.” to find PyMEL functions, as distinct from variable names. It will make your code much more readable and upgradeable, if you ever need to find and replace functions with alternatives.

Thanks, clesage. I’m actually just using maya.cmds and always use a namespace, but I was just being lazy about typing the namespaces here. I’ve never used PyMEL after all of these years.

I am indeed using xform to orient stuff and that works. I was more just pinging the crowd to see if it’s something they’ve experienced to see if it’s something within our environment that’s causing the constraint to crash or just something inherent with at least this version of Maya.

Thanks again.
Alec

Then to answer your question, yes, we’ve all seen baffling Maya-crashing bugs, from seemingly simple sources. :slight_smile:

1 Like

So this only crashes when you run the script multiple times in a row? Does it matter if you wait between clicks? or do you need to run it rapidly to induce the crash?