Version: 2018.4.26f1
var animationClipSettings = AnimationUtility.GetAnimationClipSettings(animationClip);
animationClipSettings.startTime = 0.0f;
animationClipSettings.stopTime = _stopFrameCount / animationClip.frameRate;
AnimationUtility.SetAnimationClipSettings(animationClip, animationClipSettings);
EditorUtility.SetDirty(animationClip);
AssetDatabase.CreateAsset(animationClip, path);
AssetDatabase.SaveAssets();
AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
If I open the animation file in my editor, I can see m_stopTime
set correctly. However, in the inspector window, it’s still the old value. If I restart Unity, it works.
If the value is say, 0.0333335, I just change it to 0.033334 in my text editor (so Unity sees the change), and I can see the changes.