Hey,
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[1] = CoronaRaySwitchMtl name:"CoronaRaySwitchMtl"
giMat = crsmMat.giMtlReturns:
CoronaRaySwitchMtl:CoronaRaySwitchMtl
Material #33:CoronaMtlHARDCODED METHOD EXAMPLE #2
Mat = multimaterial numsubs:2
if Mat != undefined do objMatSubs = Mat.materialListReturns:
#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.
PS.
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 iOnly returns same as the scenematerials array method. :(
By 3dwannab · 2016-09-26
barigazy · 2016-09-26