diff --git a/Runtime/Scripts/GLTFSceneImporter.cs b/Runtime/Scripts/GLTFSceneImporter.cs index c111bc31e..2bc782074 100644 --- a/Runtime/Scripts/GLTFSceneImporter.cs +++ b/Runtime/Scripts/GLTFSceneImporter.cs @@ -37,7 +37,7 @@ public class ImportOptions public IDataLoader DataLoader = null; public AsyncCoroutineHelper AsyncCoroutineHelper = null; public bool ThrowOnLowMemory = true; - public AnimationMethod AnimationMethod = AnimationMethod.Mecanim; + public AnimationMethod AnimationMethod = AnimationMethod.Legacy; public bool AnimationLoopTime = true; public bool AnimationLoopPose = false; diff --git a/Runtime/Scripts/SceneImporter/ImporterAnimation.cs b/Runtime/Scripts/SceneImporter/ImporterAnimation.cs index be9179932..4a5e696be 100644 --- a/Runtime/Scripts/SceneImporter/ImporterAnimation.cs +++ b/Runtime/Scripts/SceneImporter/ImporterAnimation.cs @@ -161,7 +161,12 @@ protected virtual async Task BuildAnimationSamplers(GLTFAnimation animation, int // copy all key frames data to animation curve and add it to the clip AnimationCurve curve = new AnimationCurve(keyframes[ci]); - clip.SetCurve(relativePath, curveType, propertyNames[ci], curve); + +#if !UNITY_EDITOR + // Only in editor SetCurve works with non-legacy clips + if (clip.legacy) +#endif + clip.SetCurve(relativePath, curveType, propertyNames[ci], curve); } }