How To Import Animations From Cinema 4d To Unity
Consign C4D Vertex Animation to Unity3D Workflow
Movie theatre 4D is one of the virtually powerful 3d modeling and movement graphic tools. Compared to Maya and Blender, C4d allows y'all 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 (cheque out my commodity here). However, the procedure of transforming bespeak-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 result from c4d 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 (complimentary)
Megafiers, Unity Avails 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 agreement, what these two plugins do hither is to bake the vertex animation as cache files, then when nosotros import the model to unity, unity is able to find these cache files and re-map the animation to each vertex on the object. Yous tin choose to generate either PLA (.mc) or MDD file because Megafier supports both of them. I baked both just in case one is non working properly.
To create PLA (.mc)file, select the 3d object, become to plugins-steadyBAKE-PLAmate, choose PLA, employ Texture-ok, and then a PLA object is generated. Y'all can at present delete all the other things. Select the PLA object and consign 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.
Process in UNITY
i. Install Megafiers from unity assets shop
2. import fbx file to unity
drag and drop the fbx file to project, and modify import setting in the inspector, then click apply:
Mesh:
Mesh Pinch: off
Read/Write Enabled: check
Optimize Mesh: Nothing
iii. 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 tin make unity very laggy depending on your hardware, be patient and bank check the progress icon to run into if information technology is all the same processing.
Brand sure yous click the root object, non the parent object, a.one thousand.a the aforementioned object yous generated enshroud files on. This is crucially important for the following steps.
Add Modify object script to the object, alter normal method to Mega.
Add Point Enshroud script to the object, then click import MDD for .mdd file, or click import MC for .mc file. If everything is right, you should be able to see the mapping progress.
After you successfully mapped vertex, yous should come across a Gizmo around the object, Cheque the Animated option under point cache script, at present the object should be animated as desired. You tin play effectually with the loop fourth dimension and interp method, see total documentation hither, or utilise the unity congenital-in animation controller to manipulate the issue.
Pro-Tip
If yous are using an old version Megafiers, you lot 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 upshot lawmaking *****
MegaModifier mod = (MegaModifier)UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(gameObject, "Assets/Mega-Fiers/Scripts/MegaFiers/Modifiers/MegaModifiers.cs (614,36)", type);
if ( mod != null )
BuildList();
render mod;
*******************************************************/
//Bug Stock-still for building on device
//This API is no longer existence used.
var theType = Arrangement.Type.GetType(blazon);
if (theType == nix || !(typeof(Component).IsAssignableFrom(theType)))
return nil;
MegaModifier mod = (MegaModifier)gameObject.AddComponent(theType);
if (modernistic != null)
BuildList();
return mod;
}
Credit: https://answers.unity.com/questions/1473672/how-to-fix-addcomponentunityenginegameobject-strin.html
Source: https://anran1015.medium.com/export-c4d-deformer-animation-to-unity3d-workflow-ec4ffd0c9a54
Posted by: batsonallind.blogspot.com
0 Response to "How To Import Animations From Cinema 4d To Unity"
Post a Comment