matmap_lib = sceneMaterials
for i in matmap_lib do
submatcount = getnumsubmtls meditMaterials[1] ----有多少个贴图材质球通道。
if submatcount != 0 then
(
for i in 1 to submatcount do
(
the_submat = getSubMtl meditMaterials[1] i ----收集材质球通道。
the_prop = getSubMtlSlotName meditMaterials[1] i ---收集材质对应的字符串内容。
if the_submat != undefined then ---材质通道如果没有指定材质,就是undefined
(
the_type = superclassof the_submat as string
initMatMap the_submat (appendMatMaps the_submat root the_prop the_type i)
deleteitem temp_type temp_type.count
deleteitem temp_subdex temp_subdex.count
)
)
)
submapcount = try(getnumsubtexmaps meditMaterials[1] )catch(0) ---有24 个通道。