Change UI colour when snap / lock is active ?

Just a quick question to you guys, is it possible using Maxscript to change the colors of the UI when snap or lock is active ?

I'm simply looking for a way to give a better indication in the viewports that snap or lock is active.

For example changing the background colour to a different shade.

thanks.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

Man you are funny.:)
You need to be patient and read mxs help.
I just wanted to give you a hint that code which do the checking will slow down max. You not want that for sure ... or what?

bga

asymptote's picture

I could use point 3 instead

I could use point 3 instead of colour if I knew what the hell I was doing :P

OK, what is the code / variable ? that listens for specific UI button presses, that may be a better place to start.

I don't want my tool to be a floater I want it to react to Max button press.

Is it possible for the viewport boundry ( yellow line) to be made bigger or as a gradient to indicate snap / lock ?

barigazy's picture

:)

You want to know what you are doing? I can tell you: you are trying to destroy max interface with this and crash max? :)
If you not want floater then use one macrobutton to trigger callback or timer control. Try to post something to see your progress.

bga

asymptote's picture

lol no! I've never written a

lol no! I've never written a maxscript before, dot net? it's all gobbledygook to me. I've tried, I simply lack the knowledge. I'll stick to modeling and texturing.
I can live without it. :P

thanks anyway.

Here's an example of my scripting skills...two buttons one for on, and one for off,
I couldn't even figure out how to change the color from anything other than black.

On...

snapmode.active = on

CurrentColor = (GetUIColor 41*255) as color

if CurrentColor != color 0 0 0 then
(
SetUIColor 41 (color 0 0 0)
colorMan.repaintUI #repaintAll
)
else
(
SetUIColor 41 (color 131 131 131)
colorMan.repaintUI #repaintAll
)
)

Off...

snapmode.active = off

CurrentColor = (GetUIColor 41*255) as color

if CurrentColor != color 0 0 0 then
(
SetUIColor 41 (color 0 0 0)
colorMan.repaintUI #repaintAll
)
else
(
SetUIColor 41 (color 131 131 131)
colorMan.repaintUI #repaintAll
)
)

btw ...it doesn't flicker ;)

barigazy's picture

:)

You can use point3 instead of color and you need to use also values 0-1 not 0-255.
So this is the way

SetUIColor 41 ([131,131,131]/255.0)

bga

asymptote's picture

Thanks barigazy but this is

Thanks barigazy but this is way beyond me, I'll have to turn this into a request script wanted instead.

barigazy's picture

...

No! you have to try a little. Your tool can be look similar to this
http://www.scriptspot.com/3ds-max/scripts/expertmode-modifiers-control
Look at the code, remove contextmenu and add two labels.
It's easy ;)

bga

asymptote's picture

Thx barigazy, that's very

Thx barigazy, that's very helpful info, now i need to figure out how to combine the snap and the background toggle...this may take a while ;)

barigazy's picture

...

The better idea is to use non-bordered dialog with two .net label controls which can indicates states of selection lock and snap mode. Mean back color of labels will be changed instead of viewport color whick can cause flickering because all UI components will be considered in color changing operation.
Anyway to trigger this operations you can use Timer control. That's my concept idea.

bga

asymptote's picture

I found this script by

I found this script by Nanne....

CurrentColor = (GetUIColor 41*255) as color

if CurrentColor != color 0 0 0 then
(
SetUIColor 41 (color 0 0 0)
colorMan.repaintUI #repaintAll
)
else
(
SetUIColor 41 (color 131 131 131)
colorMan.repaintUI #repaintAll
)
)

and this bit of code for snap....

snapmode.type = #3d

I can't find anything to toggle snap on or off, totally out of my depth here I've never scripted before :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.