- Home /
Can custom FBX data be imported into Unity ?
The art department has asked me to add custom data to FBX files at export time from Maya. (Custom camera and material animation data) This is possible with the Autodesk FBX Extensions SDK.
Is there a way for custom fbx data to be imported into Unity ?
Answer by OllyNicholson · Sep 04, 2014 at 02:40 PM
Yes there is, but as it is intrinsically custom you would need to write an asset post processor to tell Unity what you want to do with that data:
http://docs.unity3d.com/ScriptReference/AssetPostprocessor.html
As we don't have direct counterparts to all the functionality in Maya (many features designed perhaps for an offline rendering target, rather than real time platforms) then it may be difficult to implement what you want to do with that data, for example the kinds of material animation that Maya is capable of may not translate directly to UV animation or Material colour animation curves available to you in Unity. So the short answer is yes theoretically, but the long answer depends on exactly what you want to do with that custom data and what resources you have to do it.
Hi Olly,
Thanks for the reply. I have been looking over the data in my material diffuse animation fbx file. It seems the default $$anonymous$$aya FBX exporter is able to export the color animation data (AnimationCurveNode, AnimationCurves) just fine. So I don't need to export it as custom fbx data.
Although unity seems to ignore this particular fbx data, I was wondering if it is available to me in any of the AssetPostprocessor functions.
If not, would I have to specifically add it as "custom fbx data" at export time from $$anonymous$$aya and use AssetPostProcessor::OnPostprocessGameObjectWithUserProperties in order to get access to it?
Unity doesn't currently support importing animation curves for $$anonymous$$aterials via FBX, even if the FBX is able to store this data without custom data - watch this space for 5.x though. So in theory yes you would need to use the AssetPostProcessor to write something. That said you may also need the animator API upco$$anonymous$$g in 5.0 to create the animation from custom or imported material animation so as of 4.x right now I don't believe this to be possible. The only workaround is to re-create material animations inside Unity, by adding curves in the animation window.
Olly, do you have more information available about this 5.x Animator API? I am also looking to import curves for custom properties from FBX.
Presently, the only way I've found to get Unity to read this data is to manually parse through ASCII FBX formatted files and get the data from text in my AssetPostprocessor - which is far from ideal.
@OllyNicholson @Treasure$$anonymous$$ap I've a similar question about FBX custom data and I am looking for a way to easely read the data from a FBX file. How can I do that ? Here is the question : Custom Export and Import FBX Data
Your answer
Follow this Question
Related Questions
Custom attributes? 3 Answers
Import fbx using autodesk fbx sdk in real time. 2 Answers
Is it possible to use a custom object in java (my WeaponObject) as a data type (like Vector3) 1 Answer
Which version of the FBX SDK is used? 1 Answer
Advice about saving complex data (Minecraft-like game) 1 Answer