layers object material with layer names

i have 20 layers
i would like to assign standard color material
material name is layer name
is that possible
my poor skill can;t do that~~~~~

Comments

Comment viewing options

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

Layer Name = Material Name

You need to know first that layer index is 0-based.
This code works fine if Layer "0" is at the top of the list.

cnt = if LayerManager.count <= 24 then LayerManager.count else 24
for i in 0 to (cnt-1) do
(
	iLayer = layerManager.getLayer i
	if iLayer.name != "0" do (iLayer.setName (meditMaterials[i].name))
)

barigazy

dussla's picture

sorry my poor explanation

layers = 40

each layer is assigned standard material
standard material name is changed with layer name

exmaple]
original layer name = car1 , car2 car3 car4
each layer object material is not assign

my wanted]
each layers is assign material ( material name = car1, car2 car3............)
can you understand ?

barigazy's picture

It's difficult to understad

It's difficult to understad you.
Are you need material name = layer name
But you have 40 layers and 24 Material Editor slots.
Maybe is better to create material library file to store 40 mtls

barigazy

dussla's picture

thank you barigazy

yes i need material name= layer name

1. select objects in each layer
2. make material ( material name = layer name)
3. assign material to layer

can you understand ~~~~~~~~~~

barigazy's picture

which material you want to

which material you want to use
--standard
--arch&design
--Vray mtl

barigazy

dussla's picture

yes i use standard material

i use standard maerial

but for future , vray material is needed
sorry my many ask ~~

barigazy's picture

Tomorrow you will get what

Tomorrow you will get what you need and a few new things.
Code is finished but I decided to write a script.

barigazy

dussla's picture

ok i see

thank you for your effor
i will wait~~

barigazy's picture

Wait for what?

Wait for what?

barigazy

Comment viewing options

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