Is there a way to merge identical materials?

I created a small village in Cinema 4d and some of the houses share the same materials. Wenn i import it via Datasmith, Datasmith creats an onw material for every house so i end up with a bunch of identical materials. I could merge the objects with the same material that would solve the problem, but i would like to have the possibility to arrange the village in Unreal Engine, so i want to keep them seperated. Becuse of the i thought how could i merge the materials in UE5?

The datasmith importer should use just one material as well if

  • in your c4d scene the materials are the same
  • and the scene is imported with one file, instead of multiple files
    If you use multiple files, you could use the visual dataprep editor for it. In contentbrowser RMB->Dataprep → Dataprep Asset. In the Editor on the top right side you could use a folder as import source. Even further you could substitute materials while importing with the nodes

    docu
    I’ve just tested some random c4d files from the net e.g. https://free3d.com/3d-model/office-filing-cabinet-341696.html. The cabinet uses different materials for each color, you could see in the screenshot but the same colored objects share the same material in e.g. Mat_3_2 for all the white parts.
    If your scene is already here and you do not want to reimport it again, you could just apply the same material to all the assets which should share the same material. No need to merge the geometry for that.
    You could drag and drop the material to your actors in the scene, but for each time you add a new house from the content browser you would have to do that. To change it for the asset, go to the asset in the content browser and assign the material you like in the details panel.
    You can automate it with blueprints, but first, let’s figure out why your import doesn’t look like expected.
1 Like

Thanks for our answer.
It is just one file and there are no identical materials in the Cinema 4D. scene.
Could it be because i am using C4D R20?
But thanks for the hint to the dataprep asset. Thats a good point.

Thanks!

You could create a Master Material, then make however many material instances. This would let you have one material but control them separately.

You could try out the import plugin from Maxon as it is slightly newer than the UE5 datasmith import in 5.0.2 Maxon - Unreal Integration

1 Like