UnityEditor.AnimationUtility.GetAnimationClipSettings C# (CSharp) Method

GetAnimationClipSettings() private method

private GetAnimationClipSettings ( AnimationClip clip ) : AnimationClipSettings
clip UnityEngine.AnimationClip
return AnimationClipSettings
        public static extern AnimationClipSettings GetAnimationClipSettings(AnimationClip clip);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

        public void ExtractFromPreviewClip(AnimationClip clip)
        {
            AnimationClipSettings animationClipSettings = AnimationUtility.GetAnimationClipSettings(clip);

            if (this.firstFrame / clip.frameRate != animationClipSettings.startTime)
            {
                this.firstFrame = this.FixPrecisionErrors(animationClipSettings.startTime * clip.frameRate);
            }
            if (this.lastFrame / clip.frameRate != animationClipSettings.stopTime)
            {
                this.lastFrame = this.FixPrecisionErrors(animationClipSettings.stopTime * clip.frameRate);
            }
            this.orientationOffsetY = animationClipSettings.orientationOffsetY;
            this.level                    = animationClipSettings.level;
            this.cycleOffset              = animationClipSettings.cycleOffset;
            this.loopTime                 = animationClipSettings.loopTime;
            this.loopBlend                = animationClipSettings.loopBlend;
            this.loopBlendOrientation     = animationClipSettings.loopBlendOrientation;
            this.loopBlendPositionY       = animationClipSettings.loopBlendPositionY;
            this.loopBlendPositionXZ      = animationClipSettings.loopBlendPositionXZ;
            this.keepOriginalOrientation  = animationClipSettings.keepOriginalOrientation;
            this.keepOriginalPositionY    = animationClipSettings.keepOriginalPositionY;
            this.keepOriginalPositionXZ   = animationClipSettings.keepOriginalPositionXZ;
            this.heightFromFeet           = animationClipSettings.heightFromFeet;
            this.mirror                   = animationClipSettings.mirror;
            this.hasAdditiveReferencePose = animationClipSettings.hasAdditiveReferencePose;
            if (this.additiveReferencePoseFrame / clip.frameRate != animationClipSettings.additiveReferencePoseTime)
            {
                this.additiveReferencePoseFrame = this.FixPrecisionErrors(animationClipSettings.additiveReferencePoseTime * clip.frameRate);
            }
        }
All Usage Examples Of UnityEditor.AnimationUtility::GetAnimationClipSettings
AnimationUtility