Search Unity

Cinema 4D Textured Model to Unity: Best Practices

Discussion in 'Asset Importing & Exporting' started by Mantra-Games, Jan 10, 2013.

  1. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    I fiddled a lot with getting my textures to display properly in Unity using Cinema 4D and I'm wondering if any of you out there who use C4D have any tips and tricks?

    I work right in the C4D file that is in the Unity assets folder. I've tried all kinds of uvw tricks, baking object (and a variety of settings) seems to blur and distort the image slightly, baking texture doesnt even work for me. I'm using the new Studio R14 version.

    Anyway, just wondering if any of you out there use C4D and what method you use to get your textures to mirror in unity.

    cheers.
     
  2. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    I personally would advise to use .fbx instead of .c4d files. As you already found out, things aren't really working all that great so your best bet is to use the .fbx file format instead and manually export. It is a bit more work but your best option really.
     
  3. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    Alright thanks, Thomas. I'll play with .FBX some more.

    Cheers.
     
  4. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    I've been using C4D since forever and never really used the native .c4d file format. In fact, the file gets converted to fbx anyways. Doing it by hand may (often) yield better results. It's not really that much more work and you get used to it quickly.
     
  5. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    Do you use the native .fbx exporter or another .fbx plugin? I think it's version 7 or something...
     
  6. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    Ah yeah fbx does work better lol. I just recently upgraded to R14 so it must be doing something different than the previous version I had as fbx yielded crappy results.

    Cheers!
     
  7. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Stick with doing it by hand mate. You should also check the preferences in which you can define what gets exported in your FBX file.
     
  8. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    Cheers, Thomas. BTW just checked out your folio. Really nice stuff, I didnt know you worked on The Other Brothers..can't wait to play that game.

    Maybe I can hire you in the latter part of the year :)

    Cheers.
     
  9. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Cheers mate! Glad you like my work :) Just ping me anytime if you need something. PM me.

    Thomas P.
     
  10. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    What Thomas said... plus a few other tidbits below:

    The blurring you get from baking is likely that your maps are not large enough and hence result in lower res output especially if you are comparing the quality against your original tiled materials. Also make sure once baked that you Select your Material and then adjust the Editor setting (Attributes Mgr) to your new baked map size in order to view its correct resolution in the C4D viewport.

    FBX/Unity likes Objects to have UVW Mapping. Therefore if you are using Cubic, Spherical, Flat projection etc In your objects Texture Tag make sure with your Objects Texture Tag selected to then select Tags from the Attribute Mgr menu then click Genrate UVW Coordinates. This will retain the mapping you currently have and change the Projection to UVW Mapping. Else you can UV map by hand in BodyPaint.

    Don't bother baking your textures. Your maps will need to be too large to obtain a good resolution.

    Don't Lightmap in Cinema 4D unless you really need to achieve a very accurate light setup like with IES lights. The BEAST lightmapper in Unity is so much quicker workflow to create lightmaps and if you need to edit them it is literally minutes compared to going back and editing your lightmaps in C4D, rebaking and then going through the Lightmap export again. Whilst Unity lighting is not as advanced as C4D lights, you can achieve very good results with it.

    Use the normal C4D fbx exporter not the automated method as Thomas said.

    The fbx exporter in R14 did have a bug with exporting multiple materials per object when R14 was released, however I believe they fixed this in recent updates.
     
    Last edited: Jan 11, 2013
  11. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    171
    Artzfx..thanks I tried your method and that worked great. Thanks again guys.
     
  12. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Artzfx, I heve been trying to export an object by following your process but the texture making appear broken once exported to Unity3d. Most noticeably it looks like the same texture in Unity3d is mapped 3 times across one of my objects. Do you know anyway in C4d to fix this? In C4d the object looks fine and every tag has UVW mapping.
    Thanks.
     
  13. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Hi grimmy,

    Are you scaling the material on your object by adjusting the Tiles U and Tiles V settings when mapping by any chance? If so, this will be ignored when you export to FBX, even if you have UVW mapping.

    If you want to scale in such a way, leave the C4D Tile U and V settings as 1, but use the Unity X and Y Tile settings once the object is imported.
     
    Last edited: Jun 13, 2013
  14. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Sorry I'm a little late to the party but something you *have* to do when exporting realtime models from C4D is triangulation!!!
    If you only have flat surfaces it does not matter that much but if you ever have problems with oddly turned edges or even UV errors around UV-seams - you can be 90% sure it's because Unity trianglues quads differently than Cinema 4D does. So your final step before exporting to FBX should always be to select all the Polygon models and triangulate so you can be sure everything behaves the same way.
     
  15. mrotondo

    mrotondo

    Joined:
    May 20, 2014
    Posts:
    3
    I'm even later to the party, but I just wanted to say that the_motionblur's advice to triangulate my object in C4D before exporting it as an FBX solved my problem, which is good because I was completely at my wit's end. Thanks so much!
     
  16. ruimac

    ruimac

    Joined:
    Aug 10, 2014
    Posts:
    19
    Sorry for trying to bring this old post back to life but I guess it could be useful to some to know that my set of plugins to create vertex painting in Cinema 4D, now has FBX 7.2 export. So, it is easy to paint at the vertex level in Cinema 4D, no UVW and bitmaps required, and them bring the painted mesh into Unity.
    Take a look a this:
     
  17. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
  18. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I was wondering is there any possible way to correctly have the materials from Cinema4D export properly as Unity 5 materials?
     
  19. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Nope. That's not possible from any 3D application. Unity's materials are tailored towards Unity. Same with every 3D app. You can't transfer a Maya Material to Modo, either.
    Only certain basic key values transfer over: the asigned texture, material name (if you set it in Unity to import), material color and maybe things like transparency color. As a general rule, though: assign a material with a texture map and do the rest in Unity.
     
  20. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Hmmm...I wonder if it's possible to read the materials from the application file and parse it to try to match it with Unity's materials. Or if anyone would be interested in a plugin like that.
     
  21. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    I think you are better off to adjust the materials inside Unity directly as that is where they will be displayed in the end. If you set up a material to look right in one application that does not mean that it will look the same even if the maps are transferred into the coresponding slots. Falloffs and rendering are completely different.

    Maybe it's possible with a lot of tweaking and value conversions and parsing into an intermediate format like XML but I can't see any real benefit from it, actually.
     
  22. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I meant as a long-term plugin Asset Store solution for Cinema4D artists working with Unity, but yeah for myself there wouldn't be an immediate benefit.
     
  23. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @artzfx , you mention Baking Maps and adjusting them in the Editor setting in your first paragraph, but then say later to not bother baking textures. I was wondering are you talking about two separate things?
     
  24. ETech-Studios

    ETech-Studios

    Joined:
    May 27, 2015
    Posts:
    2
    @artzfx I did that but in Unity it looks as if there was only UVW mapping. If i open the FBX, it looks fine.
     
  25. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Sorry Ben, I didn't receive a notice you replied to this. The first paragraph was just a tip to use if you were baking maps in C4D. By default it displays the baked map/s in low res, so it might puzzle you why it looks poorly when first displayed after baking. I then followed up, stating it is not necessary to bake since you can use Unity lightmapping now instead. PErsonal preference really.
     
  26. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Do you have a screenshot of the Attributes Mgr in C4D with your texture selected so I can see what you are doing? Else you can send me the file and I will take a look.
     
  27. ETech-Studios

    ETech-Studios

    Joined:
    May 27, 2015
    Posts:
    2
    I figured it out. Cinema 4D put the UVW tag infront of the texture tag...
     
  28. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    :) very good.
     
  29. zzp_buaa

    zzp_buaa

    Joined:
    Jul 25, 2017
    Posts:
    1
    Thanks guys. What a party! I do learn a lot from this thread.