Exemplo n.º 1
0
        public void SaveToClip(AnimationClip clip, float fps, CurveFilterOptions filterOptions)
        {
            if (fps <= Mathf.Epsilon)
            {
                throw new ArgumentException("FPS can't be 0.0 or less");
            }

            if (filterOptions.keyframeReduction)
            {
                if (filterOptions.positionError < 0 || filterOptions.rotationError < 0 || filterOptions.scaleError < 0 || filterOptions.floatError < 0)
                {
                    throw new ArgumentException("Allowed errors for keyframe reduction cannot be negative.");
                }
            }

            if (!isRecording)
            {
                throw new InvalidOperationException("Cannot save to clip as there is nothing to save. The method TakeSnapshot() has not been called.");
            }

            SaveToClipInternal(clip, fps, filterOptions);

            AnimationUtility.onCurveWasModified?.Invoke(clip, new EditorCurveBinding(), AnimationUtility.CurveModifiedType.ClipModified);
        }
Exemplo n.º 2
0
 extern void SaveToClipInternal(AnimationClip clip, float fps, CurveFilterOptions filterOptions);