Hi,
I'm trying to simplify a long winded process, and think it may be achievable in MaxScript. Apologies my knowledge of MaxScript (and any programming) is extremely basic.
What I would like to do is convert every material in a scene to a VrayOverrideMtl, keeping the existing material in the base slot. Then apply a vrayMtl to the Reflect mtl slot, and change the diffuse color of this vrayMtl to black. I'd need the script to ignore certain objects, which could be defined as a selection, layer, etc. However thinking about this I could "cut and paste" the objects I don't want to be affected, but if it could be done through scripting then that would be great.
My main problem is that I can't see how to change the material type through scripting. I can see how it works using the listener, and manually assigning the new material type, but that's not really how I think it should work. Ideally I think I should be using something like this -
for mat in scenematerials do
(
(
if iskindof o.mat VrayOverrideMtl do
(
)
else
(
SCRIPT TO CHANGE MATERIAL TYPE, ETC
)
)
Any help would be really appreciated.
Thanks,
Dean
barigazy · 2017-11-20