Export C4D Vertex Animation to Unity3D Workflow

Anrn
5 min readJun 24, 2020

Cinema 4D is one of the most powerful 3d modeling and motion graphic tools. Compared to Maya and Blender, C4d allows you to easily create compelling visual effects using the built-in effector, such as Cloner, Explosion, Shatter, etc. The workflow of exporting keyframe animation to unity is quite straightforward (check out my article here). However, the process of transforming point-level animations to Unity3d is a pain point as Unity has no built-in support for vertex animation. It took me one day to figure out this workflow, here is an example of importing explosion effect from c4d to unity:

Explosion effect in C4D
Same animation imported to Unity

Tools I was using:

C4D R18
Unity3d, 2019.3.0f5
SteadyBAKE, C4D plugin for PLA file (free)
or
MDDIO, C4D plugin for MDD file (free)
Megafiers, Unity Assets Store, $150

Process in C4D

1. Install SteadyBAKE or MDDIO plugin

Download the plugin files and move it under MAXON/PLUGINS

2. Bake Animation

To my understanding, what these two plugins do here is to bake the vertex animation as cache files, so when we import the model to unity, unity is able to find these cache files and re-map the animation to each vertex on the object. You can choose to generate either PLA (.mc) or MDD file because Megafier supports both of them. I baked both just in case one is not working properly.

To create PLA (.mc)file, select the 3d object, go to plugins-steadyBAKE-PLAmate, choose PLA, use Texture-ok, then a PLA object is generated. You can now delete all the other things. Select the PLA object and export to FBX file.

To create MDD file, go to plugins-MDDIO-MDD Export, the MDD files will be created. You can now select the 3d model and export to FBX file.

only keep tree pla file and export to fbx model

Process in UNITY

1. Install Megafiers from unity assets store

2. import fbx file to unity

drag and drop the fbx file to project, and change import setting in the inspector, then click apply:

Mesh:
Mesh Compression: off
Read/Write Enabled: check
Optimize Mesh: Nothing

3. Map the vertex aniamtion

Drag the imported 3d model to hierarchy, if it becomes a prefab, right-click to unpack the prefab completely. Although megafiers has no limitation on vertex numbers, if your model has a big amount of vertex, the following steps can make unity very laggy depending on your hardware, be patient and check the progress icon to see if it is still processing.

Make sure you click the root object, not the parent object, a.k.a the same object you generated cache files on. This is crucially important for the following steps.

Add Modify object script to the object, change normal method to Mega.

Add Point Cache script to the object, then click import MDD for .mdd file, or click import MC for .mc file. If everything is correct, you should be able to see the mapping progress.

After you successfully mapped vertex, you should see a Gizmo around the object, Check the Animated option under point cache script, now the object should be animated as desired. You can play around with the loop time and interp method, see full documentation here, or use the unity built-in animation controller to manipulate the effect.

Animated model
Animation Controller, control parameters in mega point cache

Pro-Tip

If you are using an old version Megafiers, you might encounter issues where fix AddComponent(UnityEngine.GameObject, string, string)’ is obsolete in MegaModifer Script, and prevent you from building the project. Here is a solution to fix it:

public MegaModifier Add(string type)

{
/***** The issue code *****

MegaModifier mod = (MegaModifier)UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(gameObject, "Assets/Mega-Fiers/Scripts/MegaFiers/Modifiers/MegaModifiers.cs (614,36)", type);
if ( mod != null )
BuildList();
return mod;

*******************************************************/

//Bug Fixed for building on device
//This API is no longer being used.

var theType = System.Type.GetType(type);
if (theType == null || !(typeof(Component).IsAssignableFrom(theType)))
return null;
MegaModifier mod = (MegaModifier)gameObject.AddComponent(theType);

if (mod != null)
BuildList();
return mod;
}

Credit: https://answers.unity.com/questions/1473672/how-to-fix-addcomponentunityenginegameobject-strin.html

I figured out this workflow based on information and tutorials gathered on the internet. I am by no means an expert in VFX nor unity, I just wanted to document my process here for future reference and help people who want to achieve the same outcome. I hope this is helpful. Have fun creating :)

Reference:
https://www.renderosity.com/mod/forumpro/?thread_id=2771692
https://answers.unity.com/questions/35515/vertex-based-animation-pla-info-unity.htmlhttp://www.west-racing.com/mf/?page_id=1802https://answers.unity.com/questions/1473672/how-to-fix-addcomponentunityenginegameobject-strin.html
https://www.youtube.com/watch?v=KFlq6cW2lDc

--

--