I get a lot of CAD models as FBX or Maya files which alread have shaders assigned (usually lambert or some other standard Maya shader). Now I need to swap those shaders out with our own V-Ray or Maxwell shaders. Right now this is a manual process which I like to automate.
Prerequisites:
- Shaders are only assigned per object and not per face.
- Shader names are the same. So I want to replace a Lambert shader with the name metalAluminum with the V-Ray or Maxwell shader of the same name.
My general idea would be to:
- add a custom attribute to each mesh which contains the shader name.
- assign standard shader to all meshes
- import or reference the production shader
- read the custom attribute and then assign the shader with the same name.
Any thoughts on this approach? Is there a better way to store the shader names? Or a better way to address this whole problem?
Any hints or tips would be appreciated.
Cheers, Florian