Hello Everyone,
I'm making a script in python which should wait for the users command, and this command is switching to any component selection from object selection, so essentially, if the script is running, I'd like it to print "great" if I ever switch to Face, Edge or Vertex Selection. Is there any possible way of doing this?
Maya provides some callbacks that let you run code when certain actions occur. one of the more common one is where the selection changes.
however, i am not aware of a callback that fires when the component type changes...
to get started, look at the "scriptJob" command.
You might have to use some combination of the events "SelectTypeChanged", "SelectModeChanged", and "SelectPreferenceChanged". I get different results depending on whether I switch modes using the right-click context menu vs. using the tool buttons at the top of the screen: