Is there a script to change the color of objects to Layer Color ?

My friend gave me a lot of scenes for learning rendering, but every objects have different colors and its really disturbing....
Is there a script to let me change all the objects color to Layer Color with just one click ?

Comments

Comment viewing options

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

This is native to max (3steps instead)

See steps of attached images.
1. Select all objects
2. Click white square box of the 1st image.
3. Click mixed. That changes to By layer.

An optional step is to go to your preferences and check the box shown. This will made sure all new objects take on the properties of the layer.

AttachmentSize
step_01.jpg 4.09 KB
step_02.jpg 39.99 KB
step_03.jpg 40.43 KB
optional.jpg 295.91 KB
3dwannab's picture

Done it (AFTER I learned some scripting) :]

All objects in scene changed to ByLayer properties.

	for o in objects do
	(
		o.colorByLayer = on ; o.wirecolor = o.layer.wirecolor
		o.displaybylayer = on
		o.renderbylayer = on
		o.motionbylayer = on
	)

Just selection changed to ByLayer properties.

	for o in selection do
	(
		o.colorByLayer = on ; o.wirecolor = o.layer.wirecolor
		o.displaybylayer = on
		o.renderbylayer = on
		o.motionbylayer = on
	)
miauu's picture

.

(
	for i = 0 to LayerManager.count-1 do 
	(
		layer = LayerManager.getLayer i
		layer.nodes &theNodes
		theNodes.wirecolor = layer.wirecolor
	)
)
chunchk's picture

Adore! Thanks for your quick

Adore!

Thanks for your quick response and script, It helps a lot!

barigazy's picture

...

Or if you need to restore color of imported object for CAD software you can try this line

for o in objects where o.colorByLayer do (o.colorByLayer = off ; o.wirecolor = o.layer.wirecolor)

bga

Comment viewing options

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