Search Unity

Problems with rig-import from C4D R10

Discussion in 'Asset Importing & Exporting' started by skahlert, Apr 30, 2007.

  1. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    Hi,

    I have some serious problems importing my rigged character from C4D10.
    I should mention, that my character is heavily constraint to some helper objects (attached to the IK-Chain), so I have better overview and control over the movement. Furthermore there's some Xpresso stuff to controll thinks like eyelid and jaw movement.
    All of those things do not work. I had the idea of baking the animation like I would do it with the IK chain, but it seems like cappucino isn't able to key the scripted or constrained values.

    So: Is that a known problem? is there a workaround for it? Or do I really have to animate every little detail manually?

    Thanks,
    Stef.
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Have you updated to C4D 10.1? It fixed a bunch of issues in regards to character animation and fbx export.
     
  3. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    Yes I have.
    I'm using R10.102. I should also mention, that I import the c4d-file directly. Not via fbx export.
    I'm not surprised that the xpresso stuff isn't imported properly but there should be a way of baking that into keyframes, shouldn't it?
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Cappucino should be able to bake the IK.
    You want to ask maxon why the IK baking doesnt work on your model.
     
  5. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    That's a good idea :)
    I'll post as soon as I get a reply!
     
  6. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    Okay, I found out, why cappucino didn't work (forgot to set the bones to active *duh*).
    But now that one's working, there's still some messed-up geometry. Strangely enough, the quite complicated mesh of the character looks okay, but a simple thing like a sphere (for the eyeballs) is distorted beyond recogniton (see screenshot).

    Is that a C4D-Export or a Unity-Import problem?
     

    Attached Files:

  7. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Very good question. I dont exactly know, but i encountered the same thing on SOME of my models. I redid the rig on the distorted parts (sometimes for the complete model) and reimported. Then it usually turns out ok. In my case the distortion (not my, the models distortion! ;) ) happens mostly on a single bone at the far end of the hierarchy.
    I guess its somewhere within C4D, but i cannot tell for sure. Give it a try on redoing that part of the rig. I am really interested if that works for you too!
     
  8. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    yeah, well... the sad thing is: the sphere is not rigged at all.
    Well the eye was, but I created another sphere (without any transformations, constraint or anything) and made it editable... with quite the same result.
     
  9. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Is it part of the model, or a seperate Object? When combining the Model to a single Mesh the effect also vanishes... sometimes...

    EDIT:

    Also make sure, the bones are directly under the mesh they influence. Dont use Null-Objects or else. Just Mesh and Bones.
     
  10. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    As I said, I created a new sphere as a separate object, with connection to the rig and it was distorted, too.
    Right now I'm doing a little bit of experimenting and as it turns out, the messed-up stuff imports okay, if I delete all the other stuff (bones and character) and save it into a separate file. So I guess theres a component wich causes the trouble.

    At least this method might work as a workaround.
     
  11. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    That might be some useful information, coming far too late!
    Let's see if I understand that correctly:
    - The whole character should be one mesh.
    - The bone structure should be a child of this mesh.
    - No nulls in the bone structure.
    (why is this not documented?)

    If that's correct, I did everything wrong what I could have done wrong.
    Changing the hierarchy of the objects is not an option... well I could do it, but I certainly don't want to!

    Well... after hours of experimenting I found a way to import a more or less working version.

    But still there's this one little problem:
    Only the translation information of the root-bone (a null bone), but not the rotation information is imported. That's especially bad, because the character has to do some kind of somersault.
    (so much for murphy's law)
     
  12. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    I am struggling with similar issues, I have not needed to make the joints a child of the mesh as the skin binding seems to work, but...

    I can't make the mesh come into unity in the same restpose as in C4D - any ideas there?
     

    Attached Files:

  13. skahlert

    skahlert

    Joined:
    Apr 2, 2007
    Posts:
    34
    As far as I know joints aren't supportet in Unity yet. So you have to convert the joints to a bone structure. If you havent made IK chains or constraints yet, this should work with the C4D "joint-to-bones"-converter tool.
     
  14. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Bigkahuna posted a little tutorial here on the forums on how to convert joints to bones. Its very useful!

    And by the way, Anadin, that Character is really great!
     
  15. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    Thanks Alpha-Loup!

    Hi guys, have a look at the screenshots attached, I have made two sacks, one uses bones and one uses Joints.

    Both have a very basic 'arm' wag done using IK effectors which has then been baked to the bones/joints in question. Both versions work in Unity, see attached C4D file and FBX file.

    What is funny though, is if you use bones, you can use Hypernurbs to smooth the mesh and the smoothed mesh ends up in Unity no problem, if you use Joints though the mesh dissapears! very wierd, it is a shame as I have found it a nice way to get smooth looking meshes into Unity without having to weight every vertex.

    But the main upshot is that both joints and bones do work, both require using cappucino to bake the animation to the joints/bones.

    My only problem now is to set the rest pose for the skin so that it is correctly exported to Unity...
     

    Attached Files:

  16. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    PS I forgot to point out in the above screenshots of Unity, the bones/joints are moving and deforming the sacks as expected :)
     
  17. dbolto

    dbolto

    Joined:
    Apr 20, 2007
    Posts:
    29
    Anadin,

    Did u ever get your initial pose thing worked out. Because ur file helped a lot and I am stumped at this pose thing.

    Also, what's weird is that some files import fine and others don't when using Joints / baked. Any ideas to why i am having weird issues w/ Joints etc.? I'm using the same set up that you have in your c4d file and its weird.

    Dbolto
     
  18. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    Actually I did get the pose thing worked out amongst other things... :)

    The pose thing seemed to be related to me having built the mesh in one pose then changing the pose using the joints before rigging, so what I did was current state to object to get the mesh in the new pose I wanted and then re-skinned it. been working fine ever since.

    Also, when you mirror the joints for arms legs etc. the pivot points do not mirror correctly, you need to go to the end of the chain, the hand of foot etc. and use the align function in the mocca menu on each joint back up the new chain e.g.

    Mirror
    Left Shoulder -> Left Arm -> Left Hand

    Select Right Hand -- Align
    Select Right Arm -- Align
    Select Right Shoulder -- Align

    If you don't do this the mesh screws up in Unity (the attached bits twist to align with the joint axis!)

    Then, Cappuccino does not do the heirarchy thing, I now recomend using slection sets to select whole arms/legs/body etc. when doing the cappucino baking and do it on single frames so you can control where the keyframes are
     
  19. dbolto

    dbolto

    Joined:
    Apr 20, 2007
    Posts:
    29
    Anadin and all,

    I think I found the answer to my problems. It lies within vertex maps. Not Claude Bonet or the Weight Tool!

    Dbolto
     
  20. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    Do tell! with joints still?
     
  21. dbolto

    dbolto

    Joined:
    Apr 20, 2007
    Posts:
    29
    Sorry for taking so long to get back w/ you guys,

    Okay I will be writing a tutorial shortly to cover this more in depth, but here is what I found makes animations work in Cinema to Unity:

    1) You have to use the older method of Weight Mapping to get your animations over into Unity w/ out problems. The answer is in Vertex Maps and Restrictions.

    2) If you have one c4d file w/ various clips in the file make sure when you save the file that the timeline starts at 1 and ends at the very last frame of your last animation IE: Frames 1 - 120

    These two items really helped keep me from jumping out of my office window!!! J/K

    The Vertex Map thing should have been documented better. That's why I will cover the whole thing in more detail in my tutorial.

    Thanks, Anadin and the whole community as well as Maxon for helping me figure this monster out.

    Dbolto
     
  22. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Can someone send an animated character c4d file that works fine in C4D but doesnt import correctly in via Report Bug.app. I'd love to bring this issue up with Maxon.
     
  23. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    Hi Joachim I have sent through a file, please don't laugh too much about the model/animation, it proves a point OK?


    :D
     
  24. frigginjoe

    frigginjoe

    Joined:
    Jul 12, 2006
    Posts:
    147
    c4d 10 (I suspect) completely blew some of the vertices around the neck of a model I'd made, I believe after I'd rigger it. I only noticed when importing into unity, the neck was missing.
    I figured it was unity, but upon further inspection using it and the only other modeller I have (Cheetah3d) I found some rogue vertices, and some animation/skeletal bug stretched a few vertices on binding or moving the skeleton at some point, even though the model is normally represented correctly. (it looked a bit like the above pic)