Created
March 21, 2019 12:02
-
-
Save jaforsgren/e2aa0cd3eb218d6f51988852f597aa86 to your computer and use it in GitHub Desktop.
traverses materials, applies fix_func on vraymtl material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn traverseMaterials materialList fix_func = ( | |
/*traverses materials, applies fix_func on vraymtl materials */ | |
for mat in materialList do( | |
if mat != undefined then( | |
if (classof mat) == vraymtl then( | |
fix_func(mat) | |
) | |
else if (classof mat) == multimaterial then( | |
traverseMaterials mat.materialList fix_func | |
) | |
else if (classof mat) == VRayBlendMtl then( | |
traverseMaterials #(mat.coatMtl, mat.baseMtl) fix_func | |
) | |
else if (classof mat) == VRay2SidedMtl then( | |
traverseMaterials #(mat.frontMtl, mat.backMtl) fix_func | |
) | |
) | |
) | |
) | |
traverseMaterials sceneMaterials myFineFunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment