Skip to content

Commit 3eb6590

Browse files
committed
start adding function to export only animation
1 parent 6911c4b commit 3eb6590

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,25 @@ protected int ExportTransformHierarchy(
21762176
return numObjectsExported;
21772177
}
21782178

2179+
protected bool ExportAnimationOnly(GameObject unityGo, FbxScene fbxScene, FbxNode fbxNodeParent){
2180+
// gather all animation clips
2181+
var legacyAnim = unityGo.GetComponentsInChildren<Animation>();
2182+
var genericAnim = unityGo.GetComponentsInChildren<Animator> ();
2183+
2184+
foreach (var anim in legacyAnim) {
2185+
var animClip = anim.clip;
2186+
foreach (EditorCurveBinding uniCurveBinding in AnimationUtility.GetCurveBindings (animClip)) {
2187+
Object uniObj = AnimationUtility.GetAnimatedObject (anim.gameObject, uniCurveBinding);
2188+
if (!uniObj) {
2189+
continue;
2190+
}
2191+
Debug.LogWarning (uniObj.name + ": " + uniCurveBinding.propertyName);
2192+
}
2193+
}
2194+
2195+
return false;
2196+
}
2197+
21792198
/// <summary>
21802199
/// Export components on this game object.
21812200
/// Transform components have already been exported.

0 commit comments

Comments
 (0)