I have been working with exporting large CAD models (~10,000 parts) into Unreal Engine using Datasmith and have been very impressed by the speed and automation of it. However, a major sticking point has been the materials. With the default Datasmith Master Material, all the diffuse colours import correctly from Solidworks but as they are just simple diffuse materials in Unreal, I need to edit them to add textures and other parameters such as metalness etc. I have used Keyshot extensively in the past and it has a simple material replacement function that finds imported material names and replaces them with a material from the Keyshot library based on the material names.
I have created a modified master material that is setup to take PBR textures with additional parameters liek metalness etc but when I replace the initial Datasmith Master Material with this new one I lose all the colour information on the parts, and manually finding and linking materials is very time consuming with so many parts.
I have searched online and there are a few topics about a python script to automate the material replacement for Unreal Engine but I can’t find any solid info on it.
My main question is whether this is the best workflow?
And if so, is it possible for a python script to find and replace the basic initial materials with high quality PBR materials I add to the project? For example, many of the parts use the same default steel material from Solidworks, could a python script find all the meshes with this material and replace it with a new PBR steel material I have created? Thanks