Hi, so I created this code which executes fine in the script edtior, it toggles the checker map on/off each time you run the script in the UV editor. //This works fine int $uvToggleChecker = !$uvToggleChecker; if ($uvToggleChecker == 1) { print ("UV checker map turned on."); } else if ($uvToggleChecker == 0) { print ("UV…
a better way to do this would be to check if the UV checker is turned on or off and toggle it based off that - and not use a boolean at all. you can read the state of the checker map by querying the UI like this: int $checkerState = ` textureWindow -q -displayCheckered polyTexturePlacementPanel1`; then you can use the…
Thanks guys, I'm just learning MEL so I don't really understand the rules yet and I'm not a programmer this is my first programming language. Global variable was the problem, and I'll also check out if I can query the panels as suggested as that would be a bit cleaner, I'll post back if I can't get the panels working on my…
you need to understand the scope of a variable. in a proc the variable is local, thus you always initialized it with the same value. you need a global variable to remember the state. also good to understand variable declaration, which answers your problem with previous thread, you were declaring it twice.