C4D lose materials when combining many objects.

So I have a scene in C4D R13 and there is like 30 different textures spread across 30 different objects. When I connect all those objects, to make them one mesh, some of the faces in the resulting mesh lose the connection to their original texture.

Has anyone encountered this issue? Whats going on? Could you offer any help in how to do this?

Are you connecting the objects in C4D or Unity (mesh combiner script) ?

C4D

I want to combine then, lay out UV2 in C4D and bake them in C4D.

Okay, that is different to what I thought.

To be honest, that is a tedious process to Lightmap your scenes and even more so if you have to go back and edit your scene in C4D after importing to Unity. I have stopped Ligthmapping my scenes in C4D since Unity introduced BEAST lightmapping, because the process in Unity is so fast in comparison. Especially if you need to make edits to your objects or lighting. There was also a bug with r13 FBX exporter I reported last year that would not support multiple materials per object. The fact that using UV1 and UV2 will require a minimum of 2 materials per object caused this workflow to break.

Not sure if you have lightmapped from C4D to Unity before, so I apologise if I am stating the obvious below.

Aside of the broken fbx exporter. Once you have your original materials and UV’s applied to your objects, you need to add a plain white material to each of your objects. Bake the lighting for each object, which will generate a new object with the baked lightmap and a new Texture Tag (UV2). You then need to apply that texture tag and baked lightmap material to your original objects before exporting to Unity. That’s the summarised version and fine for single objects. If you have a scene with numerous objects it get complex. It has been a while since I used this C4D lightmap workflow to Unity so if you are not familiar with it, I would have to make a video tute to explain the entire process.