ScriptSpot

Forum topic · General Scripting

I want to generate objects with diffrent colours but same material properties?

By ohls · 2010-01-31

Description

I have a maxscript that's generates objects. But I want the objects in different colour but with same material properties

Can a script take a material from material editor and copy this and change colour or do I use multi map?

Comments (1)

Anubis · 2010-02-01

If I 'see' correct what you ask for, try this:

-- I'll assume that objects are selected
for obj in selection do
(
    obj.material = copy meditMaterials[1] -- assign a copy from slot 1
    obj.material.diffuse = random black white -- generate random diffuse color
)