PDA

View Full Version : if statement dont work?


Levitateme
07-26-2003, 09:34 AM
im trying to make it so when i press a hotkey it would turn on mayas click drag, im only wanting to use this until the tweak for maya gets compiled for maya 5.

here is what i have so far.

if ( -clickDrag true)
selectPref -clickDrag false;
else
selectPref -clickDrag true;

but im only reading out of my maya mel books, i dont know why it isnt working. i was hoping someone could figure this out for me, but explain what im doing wrong, and what there doing to make it work. it would teach me alot.
btw i hope noone reads this and assumes im just saying do this for me, i would like to know what is wrong and what i need to do to fix. thanks.

ajk48n
07-26-2003, 12:06 PM
I can't test this right now, but try

if (`-clickDrag == true`)

or

if (clickDrag == true)

The back quotes are used to get a return value from a statement, and the double equal signs test if a statement is equal to something. For instance,

x = 2, assigns x to be equal to 2, while

x == 2, says "is x equal to 2?"

I hope this works for you.

Levitateme
07-26-2003, 11:57 PM
thanks AJ, Cambell on highend fixed thsi for me. he did

if (`selectPref -q -clickDrag`)
selectPref -clickDrag false;
else
selectPref -clickDrag true;

he put a query on there. i understand why and just greatful that this works now. thanks

Levitateme
07-27-2003, 12:06 AM
does anyone know of a visual way that i could have this when turned on tell me its on? cause right now i just have to guess cause nothing tells me its on or not. like something could popup saying tweak on/tweak off? or is that a C++ question?

CGTalk Moderation
01-15-2006, 05:00 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.