Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Alex Abarca on 2022-09-01, 05:06:40
-
I have a photogrammetry of a city and I would like to add a CoronaRaySwitch in white for Global Illumation slot. Does anyone out there know how to do this on 500 materials?
-
I think the best way to handle such situation, would be to figure out how to assign different material IDs to different mesh parts and then give them single material with all the textures loaded through Corona multi-map. After that any material adjustments would be a breeze.
-
I think someone with basic maxscript skill could help with this.
-
Hi Romulus, that's a lot of work it could take days. There's 500 of these, see attachment.
-
I hope I understood the problem correctly.
try running this:
(
global whiteMat = CoronaPhysicalMtl()
global cnt = 0
whiteMat.name ="GI_white"
for obj in geometry where obj.mat != undefined do
(
raySwMat = CoronaRaySwitchMtl()
raySwMat.giMtl = whiteMat
raySwMat.reflectMtl = obj.mat
raySwMat.refractMtl = obj.mat
raySwMat.directMtl = obj.mat
raySwMat.name = ("RaySwitchMtl" + "_" + obj.name)
obj.mat = raySwMat
cnt+=1
)
print ("materials processed: " + (cnt as string))
)
please do a scene hold before you run it.