PDA

View Full Version : Toggle Component Manipulators - Reposition Using Middle Mouse


supersteve3d
11-11-2005, 09:00 AM
Hi Gurus,

The title says it all. I tried briefly to find an elegent boolean toggle to this but it turns out to be frustratingly tough. More likely than not, its my ignorance of MEL.

I'm trying to write a MEL script to toggle a setting found in preferences -> manipulators -> component manipulators -> reposition using middle mouse button.

The echo command of checking/unchecking the box returns as follows.

manipOptions -middleMouseRepositioning true;
manipOptions -middleMouseRepositioning false;

Also interesting is

manipOptions -q -middleMouseRepositioning;
// Result: 1 //

My kneejerk oneliner code comes out like this..
manipOptions -middleMouseRepositioning ( !`manipOptions -q -middleMouseRepositioning` ); Needless to say I have embarrased what little confidence I had..
Someone please enlighten me..

Cheers,

harmless
11-11-2005, 04:37 PM
// The UI will not update if the prefs window is open
// write script to support this

// query the middle mouse pref, its an int[]
int $val[0] = `manipOptions -q -middleMouseRepositioning`;

// invert
int $toggle = !$val[0];

// toggle the pref
manipOptions -middleMouseRepositioning $toggle;
print ("Setting MMB pref to " + ($toggle) + "\n");

CGTalk Moderation
11-11-2005, 04:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.