Collect all Materials in scenematerials subnum node
I was wondering if there's a less hard coded way of collecting all the materials that are wired into the scenematerials array such as multisubmaterial, blend, CoronaRaySwitchMtl, VRayBlendMtl and so on..
Each of these have different properties to check against for materials but I was hoping to see if it can be done to collect the materials in those slots by checking whether or not it's a material only node or material Array.
Has anyone done this successfully before.
HARDCODED METHOD EXAMPLE #1
crsmMat = meditMaterials = CoronaRaySwitchMtl name:"CoronaRaySwitchMtl" giMat = crsmMat.giMtl
CoronaRaySwitchMtl:CoronaRaySwitchMtl Material #33:CoronaMtl
HARDCODED METHOD EXAMPLE #2
Mat = multimaterial numsubs:2 if Mat != undefined do objMatSubs = Mat.materialList
#Multi/Sub-Object:Multimaterial(Standard:Material #34, Standard:Material #35) #(Material #34:Standard, Material #35:Standard)
It would be nice if scenematerial array would have a way to get those materials too.
I thought I could get those materials through the rootScene method but no luck.
w=rootscene[#Scene_Materials] for i in w.object do print i
Only returns same as the scenematerials array method. :(