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.
asymptote's picture

"Do not blame me if your max

"Do not blame me if your max say: "WTF is this. Bye,bye . Boom!" and crash. :)"

No worries, Max does that already ;)

Script is more than cool, I'll tweak the size and position of the boxes later, I can understand code and tweak variables that's about it :).

Thanks for you time ( although this was probably piss easy for you ;))

If you need any graphics work doing let me know :)

Thanks again.

barigazy's picture

...

Thanks I will let you know. I works architectural and design stuffs for my job but scripting is only the hobby. Send U a PM. Very cool avatar :)

bga

asymptote's picture

No....my strength is coming

No....my strength is coming up with ideas and suggesting them to people with the skills to implement them :)

I tried reading mxs help, but I fell asleep 3 lines in, it's like reading a bloody phone directory.

asymptote's picture

Why are you programmers so

Why are you programmers so reluctant to change ? Look...when Autokey key is active this happens.....

How hard would it be for a similar indication when snap / lock is active ?

And as far as destroying the UI, Autodesk are doing a good enough job of that already! :P

barigazy's picture

...

No doubt that you're right. Also one more thing: I'm not programmer. These developers do not use mxs for that

bga

asymptote's picture

Developers? I wasn't aware AD

Developers? I wasn't aware AD had any ;)

barigazy's picture

;)

Is this cool or what?

macroScript test category:"asymptote" buttonText:"SL_MODE" toolTip:"Snap | Lock State" --silentErrors:on
(
	local isOpen = false
	fn selLocked = 
	(
		selectionlock = false
		sel = selection as array
		clearselection()
		if selection.count != 0 then selectionlock = true else selectionlock = false
		select sel
		selectionlock
	)	
	fn snap_lock_state =
	(
		local snapTxt = if snapMode.active then "ON" else "OFF"
		local lockTxt = if not isCreatingObject() then (if selLocked() then "ON" else "OFF") else "OFF"
		gw.hrect ( box2 2 3 85 15 ) (if snapTxt == "ON" then red else black)
		gw.hrect ( box2 86 3 102 15 ) (if lockTxt == "ON" then red else black)
		gw.htext [7, 3, 0] ("snapMode: "+snapTxt+"    selectionLock: "+lockTxt) color:white
		gw.enlargeUpdateRect #whole
		gw.updateScreen()
		redrawViews()
	)
	on execute do
	(
		if isOpen then (unregisterRedrawViewsCallback snap_lock_state ; redrawViews() ; isOpen = off)
		else
		(
			unregisterRedrawViewsCallback snap_lock_state
			registerRedrawViewsCallback snap_lock_state ; redrawViews() 
			isOpen = on
		)
	)
	on isChecked return isOpen
)

bga

barigazy's picture

or macroscript

Plase this in MacroScripts folder
U can find it under category "asymptote".
Drag this buton someware in the toolbar.
Check it and look in the downleft corner of your viewport

AttachmentSize
bga_snap_lock_state.mcr 1.29 KB

bga

barigazy's picture

BTW

Do not blame me if your max say: "WTF is this. Bye,bye . Boom!" and crash. :)
Anyway my suggestion is to use image that you posted before for your forum avatar to recognize you next time :)
Cheers!

bga

asymptote's picture

Progress

Comment viewing options

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