Wirecolor Switcher

Hey everyone, it would be cool if a script could save the current wirecolor of the objects and by the state of an checkbutton, it would change the wirecolor of all objects that have the objID=1 to "red", obj=2 to "yellow" and obj=0 to "black".
if you now release the checkbutton the original wirecolor of the objects will come back.

Comments

Comment viewing options

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

.

Something like this?

(
	global rol_wirecolorByID
	try(destroyDialog rol_wirecolorByID)catch()
	rollout rol_wirecolorByID "miauu Change Wirecolor"
	(
		local objsWCArr = #()
		checkButton chkBtn_go "Change Wirecolor" width:140
 
		on chkBtn_go changed state do
		(
			if state then
			(
				for o in objects do
				(
					append objsWCArr #(o, o.wirecolor)
					objID = o.gbufferChannel
					case objID of
					(
						0: o.wirecolor = black
						1: o.wirecolor = red
						2: o.wirecolor = yellow						
					)
				)
			)
			else
			(
				for arr in objsWCArr do
				(
					arr[1].wirecolor = arr[2]
				)
			)
			redrawViews()
		)
	)
	createdialog rol_wirecolorByID 
 
)
Dragan_ilic's picture

Thank you miauu, you are the

Thank you miauu, you are the best :D

Comment viewing options

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