public override void OnEventFinishedMoving(FrameRange oldFrameRange)
 {
     if (AnimEvt.ControlsAnimation && oldFrameRange.Length != AnimEvt.FrameRange.Length && Flux.FUtility.IsAnimationEditable(AnimEvt._animationClip))
     {
         FAnimationEventInspector.ScaleAnimationClip(AnimEvt._animationClip, AnimEvt.FrameRange);
     }
 }
//		public override void OnTogglePreview ()
//		{
////			int currentFrame = Track.Sequence.GetCurrentFrame();
//
//			base.OnTogglePreview();
//
////			if( currentFrame >= 0 )
////				SequenceEditor.SetCurrentFrame( currentFrame );
//		}

        public override void Render(Rect rect, float headerWidth)
        {
//			bool isPreviewing = _track.IsPreviewing;

            base.Render(rect, headerWidth);

//			if( isPreviewing != _track.IsPreviewing )
//			{
//				if( Event.current.alt )
//					SyncWithAnimationWindow = true;
//			}

            switch (Event.current.type)
            {
            case EventType.DragUpdated:
                if (rect.Contains(Event.current.mousePosition))
                {
                    int numAnimationsDragged = FAnimationEventInspector.NumAnimationsDragAndDrop(Track.Sequence.FrameRate);
                    int frame = SequenceEditor.GetFrameForX(Event.current.mousePosition.x);

                    DragAndDrop.visualMode = numAnimationsDragged > 0 && Track.CanAddAt(frame) ? DragAndDropVisualMode.Copy : DragAndDropVisualMode.Rejected;
                    Event.current.Use();
                }
                break;

            case EventType.DragPerform:
                if (rect.Contains(Event.current.mousePosition))
                {
                    AnimationClip animClip = FAnimationEventInspector.GetAnimationClipDragAndDrop(Track.Sequence.FrameRate);

                    if (animClip && Mathf.Approximately(animClip.frameRate, Track.Sequence.FrameRate))
                    {
                        int frame = SequenceEditor.GetFrameForX(Event.current.mousePosition.x);
                        int maxLength;

                        if (Track.CanAddAt(frame, out maxLength))
                        {
                            FPlayAnimationEvent animEvt = FEvent.Create <FPlayAnimationEvent>(new FrameRange(frame, frame + Mathf.Min(maxLength, Mathf.RoundToInt(animClip.length * animClip.frameRate))));
                            Track.Add(animEvt);
                            FAnimationEventInspector.SetAnimationClip(animEvt, animClip);
                            DragAndDrop.AcceptDrag();
                        }
                    }

                    Event.current.Use();
                }
                break;
            }

//			if( _wasPreviewing != _track.IsPreviewing )
//			{
//				if( _wasPreviewing )
//					SequenceEditor.OnUpdateEvent.RemoveListener( OnUpdate );
//				else
//					SequenceEditor.OnUpdateEvent.AddListener( OnUpdate );
//
//				_wasPreviewing = _track.IsPreviewing;
//			}
        }
Exemple #3
0
        public static void SetAnimationClip(FPlayAnimationEvent animEvent, AnimationClip animClip)
        {
            FAnimationEventInspector editor = (FAnimationEventInspector)CreateEditor(animEvent, typeof(FAnimationEventInspector));

            editor.SetAnimationClip(animClip);

            DestroyImmediate(editor);
            FAnimationTrackInspector.RebuildStateMachine((FAnimationTrack)animEvent.Track);
        }
Exemple #4
0
        public static void Resize(FEvent evt, FrameRange newFrameRange)
        {
            if (evt.FrameRange == newFrameRange || newFrameRange.Start > newFrameRange.End)
            {
                return;
            }

            if (newFrameRange.Length < evt.GetMinLength() || newFrameRange.Length > evt.GetMaxLength())
            {
                Debug.LogError(string.Format("Trying to resize an Event to [{0},{1}] (length: {2}) which isn't a valid length, should be between [{3},{4}]", newFrameRange.Start, newFrameRange.End, newFrameRange.Length, evt.GetMinLength(), evt.GetMaxLength()), evt);
                return;
            }

            bool changedLength = evt.Length != newFrameRange.Length;

            if (!evt.GetTrack().CanAdd(evt, newFrameRange))
            {
                return;
            }

            Undo.RecordObject(evt, changedLength ? "Resize Event" : "Move Event");

            evt.Start = newFrameRange.Start;
            evt.End   = newFrameRange.End;

            if (changedLength)
            {
                if (evt is FPlayAnimationEvent)
                {
                    FPlayAnimationEvent animEvt = (FPlayAnimationEvent)evt;

                    if (animEvt.IsAnimationEditable())
                    {
                        FAnimationEventInspector.ScaleAnimationClip(animEvt._animationClip, animEvt.FrameRange);
                    }
                }
                else if (evt is FTimescaleEvent)
                {
                    ResizeAnimationCurve((FTimescaleEvent)evt, newFrameRange);
                }
            }

            EditorUtility.SetDirty(evt);

            if (FSequenceEditorWindow.instance != null)
            {
                FSequenceEditorWindow.instance.Repaint();
            }
        }
        public override void Render(Rect rect, float headerWidth)
        {
            base.Render(rect, headerWidth);

            switch (Event.current.type)
            {
            case EventType.DragUpdated:
                if (rect.Contains(Event.current.mousePosition))
                {
                    int numAnimationsDragged = FAnimationEventInspector.NumAnimationsDragAndDrop(Track.Sequence.FrameRate);
                    int frame = SequenceEditor.GetFrameForX(Event.current.mousePosition.x);

                    DragAndDrop.visualMode = numAnimationsDragged > 0 && Track.CanAddAt(frame) ? DragAndDropVisualMode.Copy : DragAndDropVisualMode.Rejected;
                    Event.current.Use();
                }
                break;

            case EventType.DragPerform:
                if (rect.Contains(Event.current.mousePosition))
                {
                    AnimationClip animClip = FAnimationEventInspector.GetAnimationClipDragAndDrop(Track.Sequence.FrameRate);

                    if (animClip && Mathf.Approximately(animClip.frameRate, Track.Sequence.FrameRate))
                    {
                        int frame = SequenceEditor.GetFrameForX(Event.current.mousePosition.x);
                        int maxLength;

                        if (Track.CanAddAt(frame, out maxLength))
                        {
                            FPlayAnimationEvent animEvt = FEvent.Create <FPlayAnimationEvent>(new FrameRange(frame, frame + Mathf.Min(maxLength, Mathf.RoundToInt(animClip.length * animClip.frameRate))));
                            Track.Add(animEvt);
                            FAnimationEventInspector.SetAnimationClip(animEvt, animClip);
                            DragAndDrop.AcceptDrag();
                        }
                    }

                    Event.current.Use();
                }
                break;
            }
        }
Exemple #6
0
        public static AnimationClip CreateAnimationClip(FPlayAnimationEvent animEvent)
        {
            FAnimationTrack track = (FAnimationTrack)animEvent.Track;

            string animName = ((FAnimationTrack)animEvent.Track).LayerName + "_" + animEvent.GetId().ToString();

            AnimationClip clip = AnimatorController.AllocateAnimatorClip(animName);

            clip.frameRate = animEvent.Sequence.FrameRate;

            Transform ownerTransform = animEvent.Owner;

            Vector3 pos = ownerTransform.localPosition;

            Vector3 rot = ownerTransform.localRotation.eulerAngles;             //ownerTransform.localEulerAngles;

            Keyframe[] xPosKeys = new Keyframe[] { new Keyframe(0, pos.x), new Keyframe(animEvent.LengthTime, pos.x) };
            Keyframe[] yPosKeys = new Keyframe[] { new Keyframe(0, pos.y), new Keyframe(animEvent.LengthTime, pos.y) };
            Keyframe[] zPosKeys = new Keyframe[] { new Keyframe(0, pos.z), new Keyframe(animEvent.LengthTime, pos.z) };

            Keyframe[] xRotKeys = new Keyframe[] { new Keyframe(0, rot.x), new Keyframe(animEvent.LengthTime, rot.x) };
            Keyframe[] yRotKeys = new Keyframe[] { new Keyframe(0, rot.y), new Keyframe(animEvent.LengthTime, rot.y) };
            Keyframe[] zRotKeys = new Keyframe[] { new Keyframe(0, rot.z), new Keyframe(animEvent.LengthTime, rot.z) };

            // set the tangent mode
            int tangentMode = 10;             // 10 is unity auto tangent mode

            for (int i = 0; i != xPosKeys.Length; ++i)
            {
                xPosKeys[i].tangentMode = tangentMode;
                yPosKeys[i].tangentMode = tangentMode;
                zPosKeys[i].tangentMode = tangentMode;

                xRotKeys[i].tangentMode = tangentMode;
                yRotKeys[i].tangentMode = tangentMode;
                zRotKeys[i].tangentMode = tangentMode;
            }

            AnimationCurve xPos = new AnimationCurve(xPosKeys);
            AnimationCurve yPos = new AnimationCurve(yPosKeys);
            AnimationCurve zPos = new AnimationCurve(zPosKeys);

            AnimationCurve xRot = new AnimationCurve(xRotKeys);
            AnimationCurve yRot = new AnimationCurve(yRotKeys);
            AnimationCurve zRot = new AnimationCurve(zRotKeys);

            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalPosition.x"), xPos);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalPosition.y"), yPos);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalPosition.z"), zPos);

            // workaround unity bug of spilling errors if you just set localEulerAngles
            Quaternion quat = ownerTransform.localRotation;

            Keyframe[]     xQuatKeys = new Keyframe[] { new Keyframe(0, quat.x), new Keyframe(animEvent.LengthTime, quat.x) };
            Keyframe[]     yQuatKeys = new Keyframe[] { new Keyframe(0, quat.y), new Keyframe(animEvent.LengthTime, quat.y) };
            Keyframe[]     zQuatKeys = new Keyframe[] { new Keyframe(0, quat.z), new Keyframe(animEvent.LengthTime, quat.z) };
            Keyframe[]     wQuatKeys = new Keyframe[] { new Keyframe(0, quat.w), new Keyframe(animEvent.LengthTime, quat.w) };
            AnimationCurve xQuat     = new AnimationCurve(xQuatKeys);
            AnimationCurve yQuat     = new AnimationCurve(yQuatKeys);
            AnimationCurve zQuat     = new AnimationCurve(zQuatKeys);
            AnimationCurve wQuat     = new AnimationCurve(wQuatKeys);

            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalRotation.x"), xQuat);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalRotation.y"), yQuat);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalRotation.z"), zQuat);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "m_LocalRotation.w"), wQuat);

            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "localEulerAngles.x"), xRot);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "localEulerAngles.y"), yRot);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.FloatCurve(string.Empty, typeof(Transform), "localEulerAngles.z"), zRot);

            clip.EnsureQuaternionContinuity();

            AssetDatabase.AddObjectToAsset(clip, track.AnimatorController);

            AnimationClipSettings clipSettings = AnimationUtility.GetAnimationClipSettings(clip);

            clipSettings.loopTime = false;
            AnimationUtility.SetAnimationClipSettings(clip, clipSettings);

            AssetDatabase.SaveAssets();

            FAnimationEventInspector.SetAnimationClip(animEvent, clip);

            return(clip);
        }
        //		private UndoPropertyModification[] UndoProperties( UndoPropertyModification[] modifications )
        //		{
        //			Debug.Log ("UndoProperties");
        //			foreach( UndoPropertyModification modification in modifications )
        //			{
        //				Debug.Log ( "obj ref: " + modification.propertyModification.objectReference + "; path: " + modification.propertyModification.propertyPath + " target:" + modification.propertyModification.target + "; value:" + modification.propertyModification.value );
        //			}
        //			return modifications;
        //		}


        public override void OnDelete()
        {
            FAnimationEventInspector.CheckDeleteAnimation(AnimEvt);
        }
        protected override void RenderEvent(FrameRange viewRange, FrameRange validKeyframeRange)
        {
            if (_animEvtSO == null)
            {
                _animEvtSO   = new SerializedObject(AnimEvt);
                _blendLength = _animEvtSO.FindProperty("_blendLength");
                _startOffset = _animEvtSO.FindProperty("_startOffset");
            }

            UpdateEventFromController();

            _animEvtSO.Update();

            FAnimationTrackEditor animTrackEditor = (FAnimationTrackEditor)TrackEditor;

            Rect transitionOffsetRect = _eventRect;

            int startOffsetHandleId = EditorGUIUtility.GetControlID(FocusType.Passive);
            int transitionHandleId  = EditorGUIUtility.GetControlID(FocusType.Passive);

            bool isBlending     = AnimEvt.IsBlending();
            bool isAnimEditable = Flux.FUtility.IsAnimationEditable(AnimEvt._animationClip);

            if (isBlending)
            {
                transitionOffsetRect.xMin  = Rect.xMin + SequenceEditor.GetXForFrame(AnimEvt.Start + AnimEvt._blendLength) - 3;
                transitionOffsetRect.width = 6;
                transitionOffsetRect.yMin  = transitionOffsetRect.yMax - 8;
            }

            switch (Event.current.type)
            {
            case EventType.MouseDown:
                if (EditorGUIUtility.hotControl == 0 && Event.current.alt && !isAnimEditable)
                {
                    if (isBlending && transitionOffsetRect.Contains(Event.current.mousePosition))
                    {
                        EditorGUIUtility.hotControl = transitionHandleId;

                        AnimatorWindowProxy.OpenAnimatorWindowWithAnimatorController((AnimatorController)AnimTrack.AnimatorController);

                        if (Selection.activeObject != _transitionToState)
                        {
                            Selection.activeObject = _transitionToState;
                        }

                        Event.current.Use();
                    }
                    else if (_eventRect.Contains(Event.current.mousePosition))
                    {
                        _mouseDown = SequenceEditor.GetFrameForX(Event.current.mousePosition.x) - AnimEvt.Start;

                        EditorGUIUtility.hotControl = startOffsetHandleId;

                        Event.current.Use();
                    }
                }
                break;

            case EventType.Ignore:
            case EventType.MouseUp:
                if (EditorGUIUtility.hotControl == transitionHandleId ||
                    EditorGUIUtility.hotControl == startOffsetHandleId)
                {
                    EditorGUIUtility.hotControl = 0;
                    Event.current.Use();
                }
                break;

            case EventType.MouseDrag:
                if (EditorGUIUtility.hotControl == transitionHandleId)
                {
                    int mouseDragPos = Mathf.Clamp(SequenceEditor.GetFrameForX(Event.current.mousePosition.x - Rect.x) - AnimEvt.Start, 0, AnimEvt.Length);

                    if (_blendLength.intValue != mouseDragPos)
                    {
                        _blendLength.intValue = mouseDragPos;

                        FPlayAnimationEvent prevAnimEvt = (FPlayAnimationEvent)animTrackEditor.Track.GetEvent(AnimEvt.GetId() - 1);

                        if (_transitionDuration != null)
                        {
                            _transitionDuration.floatValue = (_blendLength.intValue / prevAnimEvt._animationClip.frameRate) / prevAnimEvt._animationClip.length;
                        }

                        Undo.RecordObject(this, "Animation Blending");
                    }
                    Event.current.Use();
                }
                else if (EditorGUIUtility.hotControl == startOffsetHandleId)
                {
                    int mouseDragPos = Mathf.Clamp(SequenceEditor.GetFrameForX(Event.current.mousePosition.x - Rect.x) - AnimEvt.Start, 0, AnimEvt.Length);

                    int delta = _mouseDown - mouseDragPos;

                    _mouseDown = mouseDragPos;

                    _startOffset.intValue = Mathf.Clamp(_startOffset.intValue + delta, 0, AnimEvt._animationClip.isLooping ? AnimEvt.Length : Mathf.RoundToInt(AnimEvt._animationClip.length * AnimEvt._animationClip.frameRate) - AnimEvt.Length);

                    if (_transitionOffset != null)
                    {
                        _transitionOffset.floatValue = (_startOffset.intValue / AnimEvt._animationClip.frameRate) / AnimEvt._animationClip.length;
                    }

                    Undo.RecordObject(this, "Animation Offset");

                    Event.current.Use();
                }
                break;
            }

            _animEvtSO.ApplyModifiedProperties();
            if (_transitionSO != null)
            {
                _transitionSO.ApplyModifiedProperties();
            }


            switch (Event.current.type)
            {
            case EventType.DragUpdated:
                if (_eventRect.Contains(Event.current.mousePosition))
                {
                    int numAnimationsDragged = FAnimationEventInspector.NumAnimationsDragAndDrop(Evt.Sequence.FrameRate);
                    DragAndDrop.visualMode = numAnimationsDragged > 0 ? DragAndDropVisualMode.Link : DragAndDropVisualMode.Rejected;
                    Event.current.Use();
                }
                break;

            case EventType.DragPerform:
                if (_eventRect.Contains(Event.current.mousePosition))
                {
                    AnimationClip animationClipDragged = FAnimationEventInspector.GetAnimationClipDragAndDrop(Evt.Sequence.FrameRate);
                    if (animationClipDragged)
                    {
                        int animFrameLength = Mathf.RoundToInt(animationClipDragged.length * animationClipDragged.frameRate);

                        FAnimationEventInspector.SetAnimationClip(AnimEvt, animationClipDragged);

                        FrameRange maxRange = AnimEvt.GetMaxFrameRange();

                        SequenceEditor.MoveEvent(AnimEvt, new FrameRange(AnimEvt.Start, Mathf.Min(AnimEvt.Start + animFrameLength, maxRange.End)));

                        DragAndDrop.AcceptDrag();
                        Event.current.Use();
                    }
                    else
                    {
                        Event.current.Use();
                    }
                }
                break;
            }

//            FrameRange currentRange = Evt.FrameRange;

            base.RenderEvent(viewRange, validKeyframeRange);

//            if( isAnimEditable && currentRange.Length != Evt.FrameRange.Length )
//            {
//                FAnimationEventInspector.ScaleAnimationClip( AnimEvt._animationClip, Evt.FrameRange );
//            }

            if (Event.current.type == EventType.Repaint)
            {
                if (isBlending && !isAnimEditable && viewRange.Contains(AnimEvt.Start + AnimEvt._blendLength))
                {
                    GUISkin skin = FUtility.GetFluxSkin();

                    GUIStyle transitionOffsetStyle = skin.GetStyle("BlendOffset");

                    Texture2D t = FUtility.GetFluxTexture("EventBlend.png");

                    Rect r = new Rect(_eventRect.xMin, _eventRect.yMin + 1, transitionOffsetRect.center.x - _eventRect.xMin, _eventRect.height - 2);

                    Color guiColor = GUI.color;

                    Color c = new Color(1f, 1f, 1f, 0.3f);
                    c.a      *= guiColor.a;
                    GUI.color = c;

                    GUI.DrawTexture(r, t);

                    if (Event.current.alt)
                    {
                        GUI.color = Color.white;
                    }

                    transitionOffsetStyle.Draw(transitionOffsetRect, false, false, false, false);

                    GUI.color = guiColor;

//					Debug.Log ( transitionOffsetRect );
                }

//				GUI.color = Color.red;

                if (EditorGUIUtility.hotControl == transitionHandleId)
                {
                    Rect transitionOffsetTextRect = transitionOffsetRect;
                    transitionOffsetTextRect.y     -= 16;
                    transitionOffsetTextRect.height = 20;
                    transitionOffsetTextRect.width += 50;
                    GUI.Label(transitionOffsetTextRect, AnimEvt._blendLength.ToString(), EditorStyles.label);
                }

                if (EditorGUIUtility.hotControl == startOffsetHandleId)
                {
                    Rect startOffsetTextRect = _eventRect;
                    GUI.Label(startOffsetTextRect, AnimEvt._startOffset.ToString(), EditorStyles.label);
                }
            }
        }
        public static AnimationClip CreateAnimationClip(FPlayAnimationEvent animEvent)
        {
            string filePath = EditorUtility.SaveFilePanelInProject("Create Animation...", animEvent.Owner.name, "anim", "Choose path...");

            if (string.IsNullOrEmpty(filePath))
            {
                return(null);
            }

            AnimationClip clip = UnityEditor.Animations.AnimatorController.AllocateAnimatorClip(System.IO.Path.GetFileNameWithoutExtension(filePath));

            clip.frameRate = animEvent.Sequence.FrameRate;

            Transform ownerTransform = animEvent.Owner;

            Vector3    pos = ownerTransform.localPosition;
            Quaternion rot = ownerTransform.localRotation;

            Keyframe[] xPosKeys = new Keyframe[] { new Keyframe(0, pos.x), new Keyframe(animEvent.LengthTime, pos.x) };
            Keyframe[] yPosKeys = new Keyframe[] { new Keyframe(0, pos.y), new Keyframe(animEvent.LengthTime, pos.y) };
            Keyframe[] zPosKeys = new Keyframe[] { new Keyframe(0, pos.z), new Keyframe(animEvent.LengthTime, pos.z) };

            Keyframe[] xRotKeys = new Keyframe[] { new Keyframe(0, rot.x), new Keyframe(animEvent.LengthTime, rot.x) };
            Keyframe[] yRotKeys = new Keyframe[] { new Keyframe(0, rot.y), new Keyframe(animEvent.LengthTime, rot.y) };
            Keyframe[] zRotKeys = new Keyframe[] { new Keyframe(0, rot.z), new Keyframe(animEvent.LengthTime, rot.z) };
            Keyframe[] wRotKeys = new Keyframe[] { new Keyframe(0, rot.w), new Keyframe(animEvent.LengthTime, rot.w) };

            // set the tangent mode
            int tangentMode = 10;             // 10 is unity auto tangent mode

            for (int i = 0; i != xPosKeys.Length; ++i)
            {
                xPosKeys[i].tangentMode = tangentMode;
                yPosKeys[i].tangentMode = tangentMode;
                zPosKeys[i].tangentMode = tangentMode;

                xRotKeys[i].tangentMode = tangentMode;
                yRotKeys[i].tangentMode = tangentMode;
                zRotKeys[i].tangentMode = tangentMode;
                wRotKeys[i].tangentMode = tangentMode;
            }

            AnimationCurve xPos = new AnimationCurve(xPosKeys);
            AnimationCurve yPos = new AnimationCurve(yPosKeys);
            AnimationCurve zPos = new AnimationCurve(zPosKeys);

            AnimationCurve xRot = new AnimationCurve(xRotKeys);
            AnimationCurve yRot = new AnimationCurve(yRotKeys);
            AnimationCurve zRot = new AnimationCurve(zRotKeys);
            AnimationCurve wRot = new AnimationCurve(wRotKeys);

            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalPosition.x"), xPos);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalPosition.y"), yPos);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalPosition.z"), zPos);

            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalRotation.x"), xRot);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalRotation.y"), yRot);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalRotation.z"), zRot);
            AnimationUtility.SetEditorCurve(clip, EditorCurveBinding.PPtrCurve(string.Empty, typeof(Transform), "m_LocalRotation.w"), wRot);

            clip.EnsureQuaternionContinuity();

            AssetDatabase.CreateAsset(clip, filePath);

            FAnimationEventInspector.SetAnimationClip(animEvent, clip);

            return(clip);
        }