Suggestions / help on Show Diffuse in Viewport Script
Hi.
I 90% of the time name my maps in the diffuse slots with 'texmatnamehere_diffuse.ext'
I've wrote a script below which collects the scene materials and then collects the mats with only '_diffuse' in the filename and then shows them map/s in each associated material (it works with submats BTW).
I just would like any suggestions or help with the following please such as:
1. Is it easy to read a bitmap for colored values and then show texmap in the viewport and possibly ignore values like in normal maps and grey-scale obviously
2. Or just general scripting knowledge to help make the code/script better.
Thanks..
theMats = for i in scenematerials collect i theMaps = getClassInstances bitmapTexture thePattern = "*" + "diff" + "*" theDiffuseMaps = for i in theMaps where matchpattern i.filename pattern:thePattern ignoreCase:false == true collect i for o in theMats do ( -- enableHardwareMaterial o theMaps[5] true for i = 1 to theDiffuseMaps.count do try(showHWTextureMap o theDiffuseMaps[i] true)catch() for i = 1 to theDiffuseMaps.count do try(showTextureMap o theDiffuseMaps[i] true)catch() )
Comments
Thanks.
I think this script is limited to:
1. Specific render engine.
2. If say the bitmap is pluged into a Color Correct map in the diffuse slot it will not work as the bitmap is not directly in the slot.
I don't use or have VRay so don't have it installed to test.
Is no. 2 above true?
maybe its better what
maybe its better what renderer u use....
sample for vray...