Home Technical Talk

Maya: Melscript statements , the moment an object is selected)

StephenVyas
polycounter lvl 18
Offline / Send Message
StephenVyas polycounter lvl 18
I wonder if this is possible...

What I'd like to do is:
The moment I Left-click the mouse button down to select anything- an object, nurbscurve etc [Using dR_DoCmd("selectPress")]
I'd like to perform some if statements based on that objects' attributes, as soon as the leftmouse button is released.

Any ideas?
Edit: I think the solution might be found using "scriptJob" or system events...
edit#2 nevermind. got it!

Replies

  • alfalfasprossen
    please post your solutions for the case that somebody else has the same question and finds this thread ;)
  • StephenVyas
    Offline / Send Message
    StephenVyas polycounter lvl 18
    global proc updateSelWind(){
    if ( `isTrue SomethingSelected` ){
    text -edit -label "Something is selected." selText;
    // Enter any functions that you wish to occur when the object is selected.
    } else {
    text -edit -label "Nothing is selected." selText;
    }
    }
    string $windowName = `window`;
    columnLayout;
    text selText;
    updateSelWind;
    showWindow $windowName;
    scriptJob
    -parent $windowName // attach the job to the window
    -conditionChange "SomethingSelected" "updateSelWind";
Sign In or Register to comment.