Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Option to break or interrupt an executed script in case of bad code

Option to break or interrupt an executed script in case of bad code

(Copied from original User Voice forum)

 

"Many times I have made a mistake in a for-loop or wherever and then there is no way for me to stop the script from calculating except by going to the Windows Task Manager and killing the Maya application.

For example, try this in a new scene:

for ($i = 20; $i > 1; $i -2 ) {
print $i;
}

There is no way out, that was a stupid mistake but give a guy a "break" please. Maybe a hotkey of sorts. "

1 Comment
zewt
Collaborator

I've lost plenty of half-written Python scripts because of this, especially since there are some operations that seems like they should work but actually loop infinitely (some for-in ops with OpenMaya classes, if I remember correctly).  I back up anything I'm working on in the script editor often, but it still bites me from time to time.  Being able to control-pause to force break a wedged script in a pinch would be helpful.  I don't know about MEL, but in Python it could just throw KeyboardInterrupt, like pressing ^C in the Python console.

 

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

Submit Idea