Change font size
It is currently Sun Oct 01, 2023 5:36 pm


Post a new topicPost a reply Page 1 of 1   [ 7 posts ]
Author Message
PostPosted: Mon Jan 13, 2014 12:17 pm 

Joined: Thu Jan 02, 2014 12:43 pm
Posts: 22
Location: Finland
How to import motion capture data from iPi Mocap Studio (iPiMS) to Cinema 4D (C4D)

At first, please note that the workflow I describe below does not apply to all possible scenarios and pipelines. This is only a very basic example, with the following limitations:
  • This example assumes, that you have already done all the work on iPiMS side, such as recording, calibration, capturing, jitter removal + all other tuning operations. You should have your fine-tuned motion capture data waiting on the iPiMS side.
  • My target character for the motion capture data is a robot: this means that there's no weighting and/or deformation involved. The joints are connected to corresponding body parts using only basic object hierarchy parenting. There are no constraints, weights or any other more advanced connecting methods.
  • I don't use C4D's Character object or any external character tools or plugins (Cactus Dan etc.), just plain joints. At this stage, I don't even use IK chains. Just a plain character mesh, with separate body parts, rigged with C4D's built-in joints.
    Attachment:
    1-rig hierarchy.png
    1-rig hierarchy.png [ 42.51 KiB | Viewed 51187 times ]
  • I created the character from scratch, and targeted it especially for iPiMS. This means I could choose the joint locations, names and rotations freely, and make sure that most of the rig fits the mocap actor as closely as possible.
  • My character hasn't been painted; i.e. the C4D project doesn't yet have any fancy materials. There's just the default white texture, which is applied to the whole character. I have no idea how well material and texture mappings survive the FBX roundtrip I describe below.
  • My example was done with C4D R14.042 and iPiMS v2.5.1.159

1. Create your character mesh and its rigging in C4D:
  • Try to match the joint names as closely as possible to the joint/bone naming in iPiMS. You can check the iPiMS naming scheme from their Wiki pages or from the application itself.
  • It's OK if your character doesn't have all the corresponding joints or bones; in my case, my robot has no clavicles, and only one spine joint between the hips and the chest (the iPiMS template has two). It also has only 2 joints in its thumbs, while iPiMS has three. The missing joints can be labeled as "unused" in iPiMS.
  • When rigging, make sure your joints' Z axis always point along the bone, towards the next joint. This is the default in C4D (at least in my case it was). In fact, I didn't have to do any manual joint/bone alignment after I had created the rig with C4D's Joint tool. However, I've read that this can cause some serious trouble if the joint axis aren't oriented correctly.
  • I don't know how well the FBX format handles scale, but it might help if your C4D character is about the same size as your motion capture actor (although I haven't tested if scale can cause problems).

2. Export your character from C4D to an FBX file (File > Export > FBX). In the export dialog, my FBX settings were as follows:
  • FBX Version: 7.3 (2013)
  • Texture and Material: on
  • Normals: on
  • all other checkboxes: off
I'm not sure which settings actually have an effect here, but this is what I had.
Attachment:
2-C4D export settings.png
2-C4D export settings.png [ 56.43 KiB | Viewed 51187 times ]


3. Import the FBX file into your iPiMS project:
  • open the Export tab
  • select "Import target character" > "Select file..."
  • navigate to your FBX file and open it => your character appears next to your mocap actor

4. Under Motion Transfer Profile, map your character's joints to iPiMS joints from the drop-down menus. Choose "(Unused)" for joints that your character does not have (like clavicles etc. in my example). If you used an identical naming scheme in C4D, this step is boring but easy, and you only have to do it once: you can (and should) save you mapping info into an XML file with the "Save..." button in iPiMS. If you ever need to change a joint name in C4D or make any other minor mapping adjustments, you can manually edit this XML file with a text editor (which is a lot faster than doing the drop-down menu gymnastics again).

5. Play your video in iPiMS a few times to make sure all joints are mapped correctly and your C4D character is moving along with your mocap actor. If not, something is not right, either in your rig or the joint mappings (or, more likely, in the author of this tutorial).

6. Export your mocap data from iPiMS as an FBX file:
  • select "Export animation" > "General"
  • select "Save as type:" > "FBX" and click "Save"
The major point here is, that if the import and export operations were done using the same format (in this case FBX), iPiMS will also export the C4D character mesh, and not just the mocap information.

7. Import (or merge) the new FBX file into C4D (File > Open... or File > Merge...). My FBX import settings were as follows:
  • Geometry Data: on
  • Markers: on
  • Texture and Material: on
  • Animation: on
  • Poses: on
  • Normals: on
  • Convert Normals to Phong Tag Edge Breaks: on
  • Active Deformation: on
  • all other checkboxes: off
Again, I have no idea which settings are actually relevant, but this is what I had. In the following dialog, choose "iPi Default take" and leave the three checkboxes unchecked.
Attachment:
4-C4D import settings 1.png
4-C4D import settings 1.png [ 70.49 KiB | Viewed 51187 times ]


8. You should now have your original character in C4D with mocap animation... Go ahead and press play!


I'd appreciate any comments from all you C4D and/or iPiMS gurus out there; this is only a straightforward description of one workflow that seems to work, with all the limitations I listed in the beginning.


Top
 Profile  
 
PostPosted: Fri Jan 17, 2014 5:12 am 

Joined: Thu Jan 02, 2014 12:43 pm
Posts: 22
Location: Finland
heilei wrote:
My character hasn't been painted; i.e. the C4D project doesn't yet have any fancy materials. There's just the default white texture, which is applied to the whole character. I have no idea how well material and texture mappings survive the FBX roundtrip I describe below.


Addendum: after a few more tests, it seems that a FBX roundtrip from C4D to iPiMS and back does retain textures, materials and polygon selection tags as well.


Top
 Profile  
 
PostPosted: Sat Apr 12, 2014 2:05 pm 

Joined: Sat Apr 12, 2014 8:44 am
Posts: 6
I test your addendum: The fbx rountrip from C4D to ipisoft and back:

From c4d into ipi: skin ok, but loosing all textures
From ipi then to C4D: everything lost, skin and textures, skeleton only after import.


Top
 Profile  
 
PostPosted: Mon Apr 14, 2014 12:20 am 

Joined: Thu Jan 02, 2014 12:43 pm
Posts: 22
Location: Finland
I wonder if this might have something to do with absolute vs. relative texture paths? If your textures in C4D use relative paths, they probably break at some point during the FBX import/export process. I'm not at my C4D at the moment, and I really can't remember which method I used. I assume absolute texture paths should work.


Top
 Profile  
 
PostPosted: Mon Apr 14, 2014 9:01 am 

Joined: Sat Apr 12, 2014 8:44 am
Posts: 6
heilei wrote:
I wonder if this might have something to do with absolute vs. relative texture paths? If your textures in C4D use relative paths, they probably break at some point during the FBX import/export process. I'm not at my C4D at the moment, and I really can't remember which method I used. I assume absolute texture paths should work.



Reply:

In my example, i my example i used in the c4d file only materials colored etc..no real texture…to the related character model, weighted and skin.


Top
 Profile  
 
PostPosted: Mon Apr 14, 2014 10:44 pm 

Joined: Thu Jan 02, 2014 12:43 pm
Posts: 22
Location: Finland
Unfortunately I have no experience in C4D's weighting and skinning system. As I mentioned in my tutorial, it was a very basic example (no weights, no IK, no character tools etc.). It might be that adding weights and/or skin to the character somehow breaks the FBX import/export chain.

I have no idea if the FBX format even supports weights or skins. The format is very poorly documented (blame Autodesk). You might be able to test this by first exporting your scene as FBX and then importing it back in. Is the imported character still weighted and skinned?


Top
 Profile  
 
PostPosted: Tue Apr 15, 2014 1:58 pm 

Joined: Wed Apr 09, 2014 11:27 am
Posts: 6
heilei wrote:
Unfortunately I have no experience in C4D's weighting and skinning system. As I mentioned in my tutorial, it was a very basic example (no weights, no IK, no character tools etc.). It might be that adding weights and/or skin to the character somehow breaks the FBX import/export chain.

I have no idea if the FBX format even supports weights or skins. The format is very poorly documented (blame Autodesk). You might be able to test this by first exporting your scene as FBX and then importing it back in. Is the imported character still weighted and skinned?


I posted the method below in the Import/Export and Motion Transfer/Importing BVH animation thread, so it might be of use to the xxlwd@t-online.de.

The FBX format supports weights/bones (classic skinning) and has pretty much from it's beginnings.

madmonkfish wrote:
I don't use C4D... but, why not export an FBX (so there is the character and the data - already working in a single file) into C4D?

You may already do some of this, but maybe these notes will help:

The system I use is this:

A. Have a fully rigged/boned/weighted character set up in Lightwave (my program of choice).
B. From this, export a T-Pose FBX (so this is the character, all his weights and the bones in a single file) - only 1 frame is needed.
C. Now, when you are in IPI, you'll need to do import this FBX - to do this, go to the Export Tab and point it to the FBX you'd like to load in.
D. Once that is loaded, you'll need to make a Motion Transfer Profile - if you have set up a standard rig, it'll probably be already done (you'll see if it is, as your imported character will move with your IPI data).
E. If not, using the re-target drop downs, select the source IPI bones to re-map to their target bones.
F. Now, save on the Motion Transfer file (as you can reload it, if needed and you don't need to repeat the work).
G. So, at this point you now have an IPI skeleton rig that is re-targeted to your rig :)
H. Last stage, export the take to an FBX, this will save a fully rigged/weighted character in an encapsulated FBX format.
I. Then, simply load the FBX back into your CG application (or merge the FBX back with your source scene).

Hope that helps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 7 posts ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB® Forum Software © phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net