Cinema 4D Multiple UV set Lightmap Pipeline

Thought I would tie this info together in a new post.

For any Cinema 4D users wanting to use tileable textures and lightmaps inside of Unity3D on multiple objects via multiple UV sets here is a pipeline…

UVmap your Tileable Textures or Texture Atlas for your objects in C4D first. Then using Baked Object with a white material (so your lightmap has no colour baked) bake out your objects and be sure you have C4D setup to create new objects with the new Baked UV map. For the Lightmap baking workflow Thomas’s Lightmap Baking or The Game Artist - Essentials video’s explain this process very well 3dattack.us

Edit your newly baked Lightmap Material texture by changing it from the Luminance channel to the colour channel. Export your scene as .fbx

Buy yourself a copy of Cheetah3D (currently on special for $99 with free upgrade to v5) http://www.cheetah3d.com/ and then download the free UV Stepper script for Cheetah3D (kindly created by Hiroto) Cheetah3D - 3D Software for Mac

Thanks to a request by Visualizer_Productions from this forum to Hiroto to add copy/paste of UV sets from one object to another has made this process possible.

Place the UV Stepper script into the following folder using Finder:
Applications>Cheetah3D>Scripts>Tool>

Import your .fbx file into Cheetah3D. Select UV editing mode (not sure this is needed, just how I do it). Select one of your Baked objects and then select Polygon mode and Selection>Select All from top Menu. Now run the UV Stepper script from the top menu Tools>Script>Tool Script>UV Stepper. The UV Stepper panel will now appear in the Tool Panel right of screen. Under “Copy UV Set” make sure UV1 to UV2 is selected from the dropdown. Now click “Copy”. This moves your baked UV set to UV2 to appear as your Lightmap in Unity3D.

Now select your original UVmapped (tiled or Atlas) version of the same object. In polygon mode Select All and using the UV Stepper again, go to “Copy Object UV Set” and click “Copy”. Now select your previous corresponding Baked object and click “Paste” under “Copy Object UV Set”. This UV map set will be added to UV1. Delete your original UV mapped object. With your Baked object selected add a “Baked Texture” tag from the Render top menu option. We are not baking in Cheetah however the tag is required in order for the two UV sets to be retained into Unity3D.

Repeat the above for all your baked objects in your scene. Save as a Cheetah3D .jas file and import to Unity3D.

Inside Unity3D create a new material for you object using a Unity Lightmapped shader and drag your objects Tiled or Texture Atlas image inot the Diffuse channel and your Baked Cinema 4D Lightmap texture into teh Lightmap channel.

Okay it is a long workaround but at least is now possible to do for a pretty cheap price. You can even use Cheetah3D to do your animations instead of Cinema 4D.

I believe MArtin at Cheetah3D is adding some nice improvements in v5 to aide this process visually inside of Cheetah3D.

Thanks to all the above guys for allowing such a process to be possible.

Neil.

I exclusively use C4D with Unity and through the last couple of months have been testing and refining a pipeline for getting geometry with two UV sets directly into Unity from C4D. Most of the bugs are ironed out by now and its used on a day to day basis for real life projects.

The pipeline consists of two parts:

  1. A Coffee script for C4D that will export any selected geometry with two UV sets out into two C4D files containing the same geometry but each with there own single UV set (one with diffuse UVs and one with lightmap UVs).

  2. An editor script for Unity that will look up any C4D files (or FBX files) and on import copy the UV coordinates from the second C4D file and paste it unto the first C4D file, so it ends up with two UV sets inside Unity, and can be used for lightmapping etc.

The whole process is automated - so that I basically just select my geometry in C4D, click a button, switch to Unity, and have a geometry with two UV sets.

The setup is pretty straight forward (placing a couple of scripts inside C4D and Unity).

If anybody is interested I could post scripts etc. on the forum, for other C4D users out there.

Just to clear something up here. If all you need is for your object to have one tileable texture and one lightmap then there is not need for exporting two UV maps from C4D. You basically bake the lightmap only and export the lightmapped object as FBX. In Unity you can then assign the “tileable” texture onto the object along with your lightmap. Actually not really that hard. It took me a while as well to get to grips with that as I thought I NEED to export two uv maps in order to apply a tiling and a non-tiling map.

However, it would still be nice if C4D could export two uv maps so hopefully Maxon will do something about that.

Thomas


However, it would still be nice if C4D could export two uv maps so hopefully Maxon will do something about that. ----

Yeah - kinda silly that it doesnt work out of the box.

But I guess our in house fix mentioned above is very close in mimicking how a built in “2 UV export” would work and integrate in ones pipeline.

At our studio it has finally given the C4D users the ability to match 3DMax users in integration with Unity - now I can rely primarily on C4D :slight_smile:

DoodleMonkey, I would be very interested in seeing how this works. I also can’t understand why Maxon does have it as a feature by now.

Tom, although Lightmap + Tileable texture is possible, you have very little control over its orientation. With 2 UV sets, your lightmap can cover multiple objects whilst utilizing a Texture Atlas to accurately map your objects or even tile them accurately.

The bottom line is, C4D is a mature 3D app and at revision 11… it should have features like this included by now. I mentioned in another thread that, Maxon are great at producing amazing modules but leave out basic industry features. Modo is looking more appetizing each day.

EDIT: I forgot to mention I had some discussion with Sebastian Rath last week and he indicated implementing 2 UV sets under his new Cinema 4D Py4D plugin was another option http://py4d.xpresso24.com/wordpress/

I have assembled a package - and will post it sometime within the next couple of days - as I´m waiting for a minor feature update to one of the scripts from one of our coders.

Sweet, look forward to checking it out DM.

That will only work if your whole texture is tiled equally across the whole model, though - like with walls or a cube. As soon as there’s more custom tiling involved I can’t see a way around 2 UV sets if you’re not going to bake out one complete texture. And for the latter option you either lose detail or increase the file-size of the texture.

I think it’s really time Maxon get their FBX exporter right…!

My twin daughters have both ben sick with the chicken pocks these past weeks, so that´s why I have not posted anything - after Easter I´ll see to it. :slight_smile:

Sorry for the large delay - but I have finally posted our scripts to this post:

http://forum.unity3d.com/viewtopic.php?p=148778#148778

Enjoy.[/url]

Hi,

This topic is quite old (last reply from 2009) but since I’m new to Cinema4D I bumped into it anyway.

Just to clear things out: I created a cube with 2 UV maps in C4D, exported it as FBX 2010.2 and, when imported to Unity I get both UVs and I can use a lightmapped material.

So to all C4D newbies like myself: the problem seems now to be fixed.

Thanks
Bartek

Correct, with r11.5 that is now the case. My C4D>Cheetah workflow I originally posted now has geometry issues withe Cheetah 5 anyway.

Thanks Bartek for the update on this issue!

And do you guys know if the issue of multiple UV is resolved when importing c4d file directly?

Greg