Deselect transform tools (before calling function)

Deselect transform tools (before calling function)

coeuscreative
Enthusiast Enthusiast
906 Views
2 Replies
Message 1 of 3

Deselect transform tools (before calling function)

coeuscreative
Enthusiast
Enthusiast

Hi,

I have a python script that's processing all the vertices in a mesh.

I've noticed that if I run it with any of the transform tools active it runs much slower than if I have the select tool active. This isn't a big deal, but I was wondering two things...

Is there anything in my script that might be causing this?

And/or, is there any command I can insert at the beginning of the function to ensure that the select tool is active rather than any other tool, something like...

 

def processVerts():
    cmds.actvateSelectTool
    doVertStuff

 

0 Likes
Accepted solutions (1)
907 Views
2 Replies
Replies (2)
Message 2 of 3

jmreinhart
Advisor
Advisor
Accepted solution

I assume that you are selecting the verts during the script?

 

Maya manipulators are special DAG nodes (strange I know), but that means that when the selection changes they have to run calculations for the new selection. I wouldn't expect it to be a major slowdown but I suppose it's possible depending on your selection settings.

 

This should work:

cmds.setToolTo('selectSuperContext');

 

0 Likes
Message 3 of 3

coeuscreative
Enthusiast
Enthusiast

Perfect thanks

0 Likes