Home Technical Talk

Maya - make live toggle script.

Donno how useful this is to anyone else, but I really like being able to quickly toggle "live" on and off w/o having to click through lists to re-enable the previous object. Its a very simple script, might be an easier way of doing it... etc..

Basically you run the first script make the select object live. After that, running the second script will toggle it on and off. If you wanna toggle another object you simply select it and run the first script again.

The script can also work with the "modeling toolkit" or nex (thus toggling both live and slide surface). Just remove the "//" from the "dr_" lines. This is no longer needed with 2014 ext., as "live" covers both.

Hope its useful... and works.



script 1 : setLiveObject

string $sw_liveRunOnce = 1;
string $sw_setLive[] = `ls -sl`;
int $sw_setLiveReset = true;
// if using maya 2014 (non ext) or 2013, remove "//" from line below.
//dR_setSlideType("othersurface", $sw_setLive[0]);
makeLive $sw_setLive[0];

script 2 : toggleSetLive

if( $sw_setLiveReset == true) {
print "Transform constraint (Live) - OFF";
// if using maya 2014 (non ext) or 2013, remove "//" from line below.
//dR_setSlideType("off", "");
makeLive -n;
$sw_setLiveReset = false;
} else {
print "Transform constraint (Live) - ON";
// if using maya 2014 (non ext) or 2013, remove "//" from line below.
//dR_setSlideType("othersurface", $sw_setLive[0]);
makeLive $sw_setLive[0];
$sw_setLiveReset = true;
}

Replies

Sign In or Register to comment.