Feb 2002
1 / 4
Feb 2002
Mar 2016

Hi, I am trying to get a scriptJob to execute whenever the user changes the view window they're working in. ie as soon as they click from "top" to "side" I want to execute a scipt that changes which object is selected.

They say in the documentation that for a -conditionChange query one may use a "user-defined boolean condition" but there is no indication how I could do this?

This command:
scriptJob -conditionChange (getPanel -withFocus==$panel) "updateSelWind";

has this result:
// Error: Could not find condition or event named "0" //

obviously its converting the stuff in brackets immediately rather than considering it later when its time to execute the scriptJob.

Any help would be greatly appreciated.

Thanks,

Ken Goulding.

I figured that I probably had to create a "condition" for the scriptJob. That seems simple enough, but I didn't have any luck when I tried it...

condition -s "focuscondi" FocusChanged2;
global proc int focuscondi()
{
global string $panel;
$panel=getPanel -withFocus;
return (isTrue (getPanel -withFocus==$panel));
}
scriptJob -conditionFalse FocusChanged2 "fred";

Just in case anyone's interested, I worked through it - and actually read the instructions properly.

My condition wasn't executing because I hadn't told it what to depend on. Right now I'm using "idle" as the dependent condition so it checks continually. Works fine:

"condition -s "focuscondi" -d idle FocusChanged5;

14 years later

Thanks man. Its very usefull for me now! When you wrote this I was in 8th grade and didnt hear anything about maya 6 years after this

Suggested Topics

Want to read more? Browse other topics in Maya or view latest topics.