public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceKnockBack.Settings
        {
            animShootPose          = ClipBuilder.AnimationClipToDenseClip(animShootPose),
            animReferenceShootPose = ClipBuilder.AnimationClipToDenseClip(animReferenceShootPose),
            shootPoseMagnitude     = shootPoseMagnitude,
            shootPoseEnterSpeed    = shootPoseEnterSpeed,
            shootPoseExitSpeed     = shootPoseExitSpeed,
            positionMultiplier     = positionMultiplier,
            angleMultiplier        = angleMultiplier,
            shootPoseEnter         = shootPoseEnter.ToKeyframeCurveBlob(),
            shootPoseExit          = shootPoseExit.ToKeyframeCurveBlob(),
            rigReference           = RigDefinitionAsset.ConvertRig(RigReference),
            boneReferences         = new AnimSourceKnockBack.BoneReferences
            {
                hipBoneIndex = boneReferences.hipBoneIndex
            },
        };

        dstManager.AddComponentData(entity, settings);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
Beispiel #2
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());
        var actionDefinitions = dstManager.AddBuffer <AnimSourceActions.ActionDefinitions>(entity);

        // Add Actions to buffer
        for (int i = 0; i < authoringSettings.ActionDef.Length; i++)
        {
            var actionDef = new AnimSourceActions.ActionAnimationDefinition();
            actionDef.action            = authoringSettings.ActionDef[i].action;
            actionDef.animation         = ClipBuilder.AnimationClipToDenseClip(authoringSettings.ActionDef[i].animation);
            actionDef.restartTimeOffset = authoringSettings.ActionDef[i].restartTimeOffset;

            var e = new AnimSourceActions.ActionDefinitions {
                Value = actionDef
            };
            actionDefinitions.Add(e);
        }

        var settings = AnimSourceActions.Settings.Default;

        settings.ReloadBlendOutAimCurve = authoringSettings.reloadBlendOutAimCurve.ToKeyframeCurveBlob();
        settings.BasePoseClip           = ClipBuilder.AnimationClipToDenseClip(authoringSettings.ActionAnimationsBasePose);
        dstManager.AddComponentData(entity, settings);

        dstManager.AddBuffer <AnimSourceActions.ActionAnimations>(entity);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
Beispiel #3
0
        public void CheckAnimationClipAndDenseClipHaveSameData()
        {
            var clip          = new AnimationClip();
            var constantCurve = AnimationCurve.Constant(0.0f, 1.0f, 0.0f);

            clip.SetCurve("", typeof(Transform), "m_LocalPosition.x", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalPosition.y", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalPosition.z", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalRotation.x", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalRotation.y", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalRotation.z", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalRotation.w", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalScale.x", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalScale.y", constantCurve);
            clip.SetCurve("", typeof(Transform), "m_LocalScale.z", constantCurve);

            clip.SetCurve("Child1", typeof(Transform), "m_LocalPosition.x", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalPosition.y", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalPosition.z", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalRotation.x", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalRotation.y", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalRotation.z", constantCurve);
            clip.SetCurve("Child1", typeof(Transform), "m_LocalRotation.w", constantCurve);

            clip.SetCurve("Child2", typeof(Transform), "m_LocalPosition.x", constantCurve);
            clip.SetCurve("Child2", typeof(Transform), "m_LocalPosition.y", constantCurve);
            clip.SetCurve("Child2", typeof(Transform), "m_LocalPosition.z", constantCurve);

            var denseClip  = ClipBuilder.AnimationClipToDenseClip(clip);
            var frameCount = (int)(clip.length * clip.frameRate);

            Assert.That(denseClip.Value.SampleRate, Is.EqualTo(clip.frameRate));
            Assert.That(denseClip.Value.FrameCount, Is.EqualTo(frameCount));

            ref var bindings = ref denseClip.Value.Bindings;
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var settings = new AnimSourceStand.Settings
        {
            StandClip           = ClipBuilder.AnimationClipToDenseClip(AnimIdle),
            TurnLeftClip        = ClipBuilder.AnimationClipToDenseClip(AnimTurnL),
            TurnRightClip       = ClipBuilder.AnimationClipToDenseClip(AnimTurnR),
            StandAimLeftClip    = ClipBuilder.AnimationClipToDenseClip(AnimAimLeft),
            StandAimMidClip     = ClipBuilder.AnimationClipToDenseClip(AnimAimMid),
            StandAimRightClip   = ClipBuilder.AnimationClipToDenseClip(AnimAimRight),
            AdditiveRefPoseClip = ClipBuilder.AnimationClipToDenseClip(AdditiveRefPose),

            animTurnAngle         = animTurnAngle,
            aimTurnLocalThreshold = aimTurnLocalThreshold,
            turnSpeed             = turnSpeed,
            turnThreshold         = turnThreshold,
            turnTransitionSpeed   = turnTransitionSpeed,
            aimDuringReloadPitch  = aimDuringReloadPitch,
            aimDuringReloadYaw    = aimDuringReloadYaw,
        };

        dstManager.AddComponentData(entity, new AnimSource.Data());
        dstManager.AddComponentData(entity, settings);
        dstManager.AddBuffer <AnimSourceStand.SimpleTransition.PortWeights>(entity);
    }
 public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
 {
     dstManager.AddComponentData(entity, new PlayClipComponent
     {
         Clip = ClipBuilder.AnimationClipToDenseClip(Clip)
     });
 }
Beispiel #6
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var graphSetup = new ClipLoopPlayerSetup
        {
            Clip = ClipBuilder.AnimationClipToDenseClip(Clip)
        };

        dstManager.AddComponentData(entity, graphSetup);
    }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());
        var settings = new AnimSourceDeath.Settings {
            Clip = ClipBuilder.AnimationClipToDenseClip(Clip)
        };

        dstManager.AddComponentData(entity, settings);
    }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        settings.ClipRef = ClipBuilder.AnimationClipToDenseClip(SquashClip);
        dstManager.AddComponentData(entity, settings);

        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var graphSetup = new ConfigurableClipSetup
        {
            Clip     = ClipBuilder.AnimationClipToDenseClip(Clip),
            ClipTime = ClipTimeInit,
            MotionID = m_MotionId
        };

        dstManager.AddComponentData(entity, graphSetup);
    }
        public void OneTimeSetup()
        {
            var skeletonNodes = new[]
            {
                new SkeletonNode {
                    ParentIndex = -1, Id = string.Empty, AxisIndex = -1
                },
                new SkeletonNode {
                    ParentIndex = 0, Id = "Child1", AxisIndex = -1
                },
                new SkeletonNode {
                    ParentIndex = 0, Id = "Child2", AxisIndex = -1
                }
            };

            RigDefinition = RigBuilder.CreateRigDefinition(skeletonNodes);

            var r        = new Mathematics.Random(0x12345678);
            var range    = new float3(100);
            var fullClip = new UnityEngine.AnimationClip();

            // add some error into the clip, so it is not perfectly frame aligned
            float clipDuration = clipFrames / fullClip.frameRate + 0.123f / fullClip.frameRate;


            CreateLinearTranslate(fullClip, string.Empty, float3.zero, new float3(0, 1, 0), clipDuration);
            CreateLinearTranslate(fullClip, "Child1", r.NextFloat3(-range, range), r.NextFloat3(-range, range), clipDuration);
            CreateLinearTranslate(fullClip, "Child2", r.NextFloat3(-range, range), r.NextFloat3(-range, range), clipDuration);
            CreateRotation(fullClip, string.Empty, quaternion.identity, r.NextQuaternionRotation(), clipDuration);
            CreateRotation(fullClip, "Child1", r.NextQuaternionRotation(), r.NextQuaternionRotation(), clipDuration);
            CreateRotation(fullClip, "Child2", r.NextQuaternionRotation(), r.NextQuaternionRotation(), clipDuration);
            CreateScale(fullClip, string.Empty, new float3(1), new float3(1), clipDuration);
            CreateScale(fullClip, "Child1", new float3(1), new float3(2), clipDuration);
            CreateScale(fullClip, "Child2", new float3(2), new float3(3), clipDuration);
            FullAnimationClip = ClipBuilder.AnimationClipToDenseClip(fullClip);

            var partialClip = new UnityEngine.AnimationClip();

            CreateLinearTranslate(partialClip, "Child1", r.NextFloat3(-range, range), r.NextFloat3(-range, range), clipDuration);
            CreateRotation(partialClip, string.Empty, quaternion.identity, r.NextQuaternionRotation(), clipDuration);
            CreateRotation(partialClip, "Child2", quaternion.identity, r.NextQuaternionRotation(), clipDuration);
            CreateScale(partialClip, string.Empty, float3.zero, new float3(1), clipDuration);
            PartialAnimationClip = ClipBuilder.AnimationClipToDenseClip(partialClip);

            var alignedClip = new UnityEngine.AnimationClip();

            CreateLinearTranslate(alignedClip, string.Empty, float3.zero, new float3(0, 1, 0), 1.0f);
            CreateLinearTranslate(alignedClip, "Child1", r.NextFloat3(-range, range), r.NextFloat3(-range, range), 1.0f);
            CreateLinearTranslate(alignedClip, "Child2", r.NextFloat3(-range, range), r.NextFloat3(-range, range), 1.0f);
            CreateRotation(alignedClip, string.Empty, quaternion.identity, r.NextQuaternionRotation(), 1.0f);
            AlignedClip = ClipBuilder.AnimationClipToDenseClip(alignedClip);
        }
Beispiel #11
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var denseClip1 = ClipBuilder.AnimationClipToDenseClip(Clip1);
        var denseClip2 = ClipBuilder.AnimationClipToDenseClip(Clip2);

        var graphSetup = new TwoClipsAndMixerSetup
        {
            Clip1 = denseClip1,
            Clip2 = denseClip2
        };

        dstManager.AddComponentData(entity, graphSetup);
    }
Beispiel #12
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceDamage.Settings
        {
            Blend           = Blend,
            AdditiveRefPose = ClipBuilder.AnimationClipToDenseClip(AdditiveRefPose),
        };

        BlendTreeEntityStoreHelper.AddBlendTree1DComponents(dstManager, entity, BlendTreeAsset);

        dstManager.AddComponentData(entity, settings);
    }
Beispiel #13
0
        public static void BuildClipBlobAsset(string path)
        {
            var animationClip = AssetDatabase.LoadMainAssetAtPath(path) as AnimationClip;

            if (animationClip == null)
            {
                throw new NullReferenceException($"Asset '{path}' not found");
            }

            var blobPath = GetBlobAssetPath(path);

            var clip = ClipBuilder.AnimationClipToDenseClip(animationClip);

            BlobFile.WriteBlobAsset(ref clip, blobPath);
        }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceSprint.Settings
        {
            animAimDownToUp  = ClipBuilder.AnimationClipToDenseClip(animAimDownToUp),
            additiveRefPose  = ClipBuilder.AnimationClipToDenseClip(additiveRefPose),
            changeDirSpeed   = changeDirSpeed,
            stateResetWindow = stateResetWindow,
        };

        BlendTreeEntityStoreHelper.AddBlendTree1DComponents(dstManager, entity, LocoBlendTreeAsset);

        dstManager.AddComponentData(entity, settings);
    }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceInAir.Settings
        {
            animInAir            = ClipBuilder.AnimationClipToDenseClip(animInAir),
            animLandAntic        = ClipBuilder.AnimationClipToDenseClip(animLandAntic),
            animAimDownToUp      = ClipBuilder.AnimationClipToDenseClip(animAimDownToUp),
            AdditiveRefPose      = ClipBuilder.AnimationClipToDenseClip(AdditiveRefPose),
            landAnticStartHeight = landAnticStartHeight,
            blendDuration        = blendDuration,
            aimDuringReloadPitch = aimDuringReloadPitch,
        };

        dstManager.AddComponentData(entity, settings);
    }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var settings = new AnimSourceJump.Settings
        {
            JumpClip              = ClipBuilder.AnimationClipToDenseClip(JumpClip),
            JumpAimVerticalClip   = ClipBuilder.AnimationClipToDenseClip(JumpAimVerticalClip),
            JumpAimHorizontalClip = ClipBuilder.AnimationClipToDenseClip(JumpAimHorizontalClip),
            AdditiveRefPose       = ClipBuilder.AnimationClipToDenseClip(AdditiveRefPose),
            MaxHipOffset          = MaxHipOffset,
            HipDragSpeed          = HipDragSpeed,
            jumpHeight            = jumpHeight,
            aimDuringReloadPitch  = aimDuringReloadPitch,
        };

        dstManager.AddComponentData(entity, new AnimSource.Data());
        dstManager.AddComponentData(entity, settings);
    }
Beispiel #17
0
        internal static void CloseTypeDialog()
        {
            if (fadeState != FadeNone)
            {
                return;
            }

            var linfos      = typeDialog.GetComponentsInChildren <LevelInfoController>();
            var targetScale = Vector3.one * 0.01f;

            foreach (var linfo in linfos)
            {
                var clip = new ClipBuilder().LocalScale(linfo.transform.localScale, targetScale, 0, LevelsDisplayTime).Clip;
                linfo.GetComponent <Animation>().AddClip(clip, "animback");
                linfo.GetComponent <Animation>().Play("animback");
            }
            fadeState = FadeOut;
        }
Beispiel #18
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        if (dstManager.HasComponent<Rig>(entity))
        {
            var srcRigPrefab = conversionSystem.TryGetPrimaryEntity(SourceRigPrefab);
            var srcRigDefinition = dstManager.GetComponentData<Rig>(srcRigPrefab);
            var dstRigDefinition = dstManager.GetComponentData<Rig>(entity);

            var graphSetup = new RetargetSetup
            {
                SrcClip = ClipBuilder.AnimationClipToDenseClip(SourceClip),
                SrcRig = srcRigDefinition.Value,
                RemapTable = m_RemapQuery.ToRigRemapTable(srcRigDefinition.Value, dstRigDefinition.Value)
            };

            dstManager.AddComponentData(entity, graphSetup);
        }
    }
Beispiel #19
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        if (dstManager.HasComponent <Rig>(entity))
        {
            var denseClip1 = ClipBuilder.AnimationClipToDenseClip(Clip1);
            var denseClip2 = ClipBuilder.AnimationClipToDenseClip(Clip2);
            var rig        = dstManager.GetComponentData <Rig>(entity);

            var graphSetup = new FeatherBlendSetup
            {
                Clip1         = denseClip1,
                Clip2         = denseClip2,
                DefaultWeight = DefaultWeight,
                WeightTable   = m_FeatherBlendQuery.ToChannelWeightTable(rig)
            };

            dstManager.AddComponentData(entity, graphSetup);
        }
    }
Beispiel #20
0
        public static BlobAssetReference <Clip> Convert(UnityEngine.Motion motion)
        {
            var animationClip = motion as AnimationClip;

//            var blendTree = motion as BlendTree;
//
//            if (blendTree != null)
//                return Convert(blendTree);
//            else if( animationClip != null)
            if (animationClip != null)
            {
                var clip = ClipBuilder.AnimationClipToDenseClip(animationClip);
                return(clip);
            }
            else
            {
                throw new System.ArgumentException($"Selected Motion type is not supported.");
            }
        }
Beispiel #21
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        if (Clips == null || Clips.Length == 0)
        {
            UnityEngine.Debug.LogError("No clips specified for performance test!");
            return;
        }

        var clipBuffer = dstManager.AddBuffer <PerformanceSetupAsset>(entity);

        for (int i = 0; i < Clips.Length; ++i)
        {
            clipBuffer.Add(new PerformanceSetupAsset {
                Clip = ClipBuilder.AnimationClipToDenseClip(Clips[i])
            });
        }

        dstManager.AddComponent <PerformanceSetup>(entity);
    }
        private static int ConvertSimpleDirectional2DBlendTree(BlendTree blendTree, Entity entity, EntityManager entityManager, BakeOptions bakeOptions)
        {
            if (!entityManager.HasComponent <BlendTree2DResource>(entity))
            {
                entityManager.AddBuffer <BlendTree2DResource>(entity);
            }

            if (!entityManager.HasComponent <BlendTree2DMotionData>(entity))
            {
                entityManager.AddBuffer <BlendTree2DMotionData>(entity);
            }

            var blendTreeResources  = entityManager.GetBuffer <BlendTree2DResource>(entity);
            var blendTreeMotionData = entityManager.GetBuffer <BlendTree2DMotionData>(entity);

            var blendTreeIndex = blendTreeResources.Length;

            blendTreeResources.Add(new BlendTree2DResource {
                MotionCount      = blendTree.children.Length,
                MotionStartIndex = blendTreeMotionData.Length
            });

            for (int i = 0; i < blendTree.children.Length; i++)
            {
                var motionData = new BlendTree2DMotionData {
                    MotionPosition = blendTree.children[i].position,
                    MotionSpeed    = blendTree.children[i].timeScale,
                };

                var clip = ClipBuilder.AnimationClipToDenseClip(blendTree.children[i].motion as AnimationClip);
                if (bakeOptions.NeedBaking)
                {
                    clip = UberClipNode.Bake(bakeOptions.RigDefinition, clip, bakeOptions.ClipConfiguration, bakeOptions.SampleRate);
                }

                motionData.Motion.Clip = clip;

                blendTreeMotionData.Add(motionData);
            }

            return(blendTreeIndex);
        }
Beispiel #23
0
        private void AnimateSeparation(float time, float newSeparation)
        {
            Anim.wrapMode          = WrapMode.Once;
            Anim.playAutomatically = false;
            Anim.Rewind();

            var clipBuilder = new ClipBuilder(GetClip("separate"));

            for (int i = 0; i < coins.Length; i++)
            {
                var coin = coins[i];
                var coinLocalPosition = GetCoinLocalPosition(i, coins.Length, newSeparation);
                clipBuilder.LocalPosition(coin, coin.transform.position, coinLocalPosition, time);
            }
            float scale = separation != 0 ? 0.95f : 1f;

            clipBuilder.LocalScale(gameObject.transform.localScale, Vector3.one * scale, time);
            ReplaceAndPlay(clipBuilder.Clip, "separate");
            separation = newSeparation;
        }
Beispiel #24
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceRun8Dir.Settings
        {
            RunAimClipRef           = ClipBuilder.AnimationClipToDenseClip(RunAimClipRef),
            RunAimHorizontalClipRef = ClipBuilder.AnimationClipToDenseClip(RunAimHorizontalClipRef),
            AdditiveRefPose         = ClipBuilder.AnimationClipToDenseClip(AdditiveRefPose),
            MaxHipOffset            = MaxHipOffset,
            HipDragSpeed            = HipDragSpeed,
            damping                  = damping,
            maxStep                  = maxStep,
            StateResetWindow         = StateResetWindow,
            blendOutAimOnReloadPitch = blendOutAimOnReloadPitch,
        };

        BlendTreeEntityStoreHelper.AddBlendTree2DComponents(dstManager, entity, RunBlendSpace2D);

        dstManager.AddComponentData(entity, settings);
    }
Beispiel #25
0
        private void AnimateImage(float time, float separation, float ratio)
        {
            if (coins == null)
            {
                return;
            }

            Anim.Stop();
            Anim.wrapMode          = WrapMode.Once;
            Anim.playAutomatically = false;
            Anim.Rewind();
            var clipBuilder = new ClipBuilder(GetClip("separate"));

            for (int i = 0; i < coins.Length; i++)
            {
                var coin = coins[i];
                var coinLocalPosition = GetCoinLocalPosition(i, coins.Length, separation);
                clipBuilder.LocalPosition(coins[i], coin.transform.position, coinLocalPosition, time);
            }
            clipBuilder.LocalScale(gameObject.transform.localScale, Vector3.one * ratio, time);
            ReplaceAndPlay(clipBuilder.Clip, "separate");
        }
Beispiel #26
0
    public override void AddGraphSetupComponent(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var walkShortLeftClip  = ClipBuilder.AnimationClipToDenseClip(WalkShortLeftClip);
        var walkLongLeftClip   = ClipBuilder.AnimationClipToDenseClip(WalkLongLeftClip);
        var walkStraightClip   = ClipBuilder.AnimationClipToDenseClip(WalkStraightClip);
        var walkLongRightClip  = ClipBuilder.AnimationClipToDenseClip(WalkLongRightClip);
        var walkShortRightClip = ClipBuilder.AnimationClipToDenseClip(WalkShortRightClip);

        var jogShortLeftClip  = ClipBuilder.AnimationClipToDenseClip(JogShortLeftClip);
        var jogLongLeftClip   = ClipBuilder.AnimationClipToDenseClip(JogLongLeftClip);
        var jogStraightClip   = ClipBuilder.AnimationClipToDenseClip(JogStraightClip);
        var jogLongRightClip  = ClipBuilder.AnimationClipToDenseClip(JogLongRightClip);
        var jogShortRightClip = ClipBuilder.AnimationClipToDenseClip(JogShortRightClip);

        var clipConfiguration = new ClipConfiguration();

        clipConfiguration.Mask  = ClipConfigurationMask.LoopTime | ClipConfigurationMask.CycleRootMotion | ClipConfigurationMask.DeltaRootMotion;
        clipConfiguration.Mask |= LoopValues ? ClipConfigurationMask.LoopValues : 0;
        clipConfiguration.Mask |= BankPivot ? ClipConfigurationMask.BankPivot : 0;

        clipConfiguration.MotionID = m_MotionId;

        var graphSetup = new AnimationControllerSetup
        {
            WalkShortLeftClip  = walkShortLeftClip,
            WalkLongLeftClip   = walkLongLeftClip,
            WalkStraightClip   = walkStraightClip,
            WalkLongRightClip  = walkLongRightClip,
            WalkShortRightClip = walkShortRightClip,

            JogShortLeftClip  = jogShortLeftClip,
            JogLongLeftClip   = jogLongLeftClip,
            JogStraightClip   = jogStraightClip,
            JogLongRightClip  = jogLongRightClip,
            JogShortRightClip = jogShortRightClip,
        };

        if (Bake)
        {
            var rigDefinition = dstManager.GetComponentData <Rig>(entity);

            graphSetup.WalkShortLeftClip  = UberClipNode.Bake(rigDefinition.Value, walkShortLeftClip, clipConfiguration, SampleRate);
            graphSetup.WalkLongLeftClip   = UberClipNode.Bake(rigDefinition.Value, walkLongLeftClip, clipConfiguration, SampleRate);
            graphSetup.WalkStraightClip   = UberClipNode.Bake(rigDefinition.Value, walkStraightClip, clipConfiguration, SampleRate);
            graphSetup.WalkLongRightClip  = UberClipNode.Bake(rigDefinition.Value, walkLongRightClip, clipConfiguration, SampleRate);
            graphSetup.WalkShortRightClip = UberClipNode.Bake(rigDefinition.Value, walkShortRightClip, clipConfiguration, SampleRate);

            graphSetup.JogShortLeftClip  = UberClipNode.Bake(rigDefinition.Value, jogShortLeftClip, clipConfiguration, SampleRate);
            graphSetup.JogLongLeftClip   = UberClipNode.Bake(rigDefinition.Value, jogLongLeftClip, clipConfiguration, SampleRate);
            graphSetup.JogStraightClip   = UberClipNode.Bake(rigDefinition.Value, jogStraightClip, clipConfiguration, SampleRate);
            graphSetup.JogLongRightClip  = UberClipNode.Bake(rigDefinition.Value, jogLongRightClip, clipConfiguration, SampleRate);
            graphSetup.JogShortRightClip = UberClipNode.Bake(rigDefinition.Value, jogShortRightClip, clipConfiguration, SampleRate);

            clipConfiguration.Mask     = ClipConfigurationMask.NormalizedTime | ClipConfigurationMask.LoopTime | ClipConfigurationMask.RootMotionFromVelocity;
            clipConfiguration.MotionID = 0;
        }
        else
        {
            clipConfiguration.Mask |= ClipConfigurationMask.NormalizedTime;
        }

        graphSetup.Configuration = clipConfiguration;
        dstManager.AddComponentData(entity, graphSetup);
    }