Hi,
I need help from the codemasters over here. Basically this is what i wanted o do:
1. select all object in scene (all object has a multi/sub mat)
2. swap material id [1] with [5]
3. collapse multi/sub material to standard material
i've tried to search more info on this online but just couldn't figure ou where to start.
Hope there's any good guy greg around here willing to help me. Please!
Comments (3)
Comment policy
Just to know if it possible
Hi Barigazy,
First of all, thanks you so much for your reply. The 3rd option is actually not a urgent requirement at this moment, just for the sake of learning whether if it is possible.
If it really is possible, then could you kindly write down the syntax so that i can google the syntax and try to make sense of it?
Again, thank you so much.
#3
Let's continue
-- Create a box and assigne multisub mtl with 6 standard materials with different diffuse colors and name theses mtls with color name.
-- #1 color names array
colorArr = #("Red","Green","Yellow","Blue","Brown","Orange")
-- #2 multisub materials list (6 standard materials)
multiSubMtlsArr = (for i = 1 to colorArr.count collect (Standard name:colorArr[i] diffuse:(execute colorArr[i])))
-- #3 multisub material
objMaterial = multimaterial name:"BoxMaterial" materialList:multiSubMtlsArr
-- #4 simble object (Box) for recive these material
obj = Box name:"testObject" material:objMaterial
-- now to remove nox material you can use
obj.material = undefined
-- to collaps (change) box material to standard mtl
obj.material = Standard()
-- to collaps box material to first sub material (in this case "Red")
obj.material = obj.material.materialList[1]
-- or
obj.material = objMaterial.materialList[1]
let's start
1.select all object in scene (all object has a multi/sub mat)
You need to consider this:
if you want to swap 1st ID with 5th then you scene object must have minimum five mtlID.
To select all objects that should satisfy the following conditions:
2. swap material id [1] with [5]
-- now you can do:
And why do you need 3rd options. Why you want to collapse multisub material?