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 [ 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 [ 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 [ 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.