コード例 #1
0
        public void ValidateBaseData()
        {
            if (MotionModifier == null)
                MotionModifier = new MotionModifyData();

            if (Events == null)
                Events = new List<EventMarker>();

            if (TagTracks == null)
                TagTracks = new List<TagTrack>();

            if (FavourTagTracks == null)
                FavourTagTracks = new List<TagTrack>();

            if (GeneratedEvents == null)
                GeneratedEvents = new List<EventMarker>();

            if (GeneratedTagTracks == null)
                GeneratedTagTracks = new List<TagTrack>();

            if (GeneratedFavourTagTracks == null)
                GeneratedFavourTagTracks = new List<TagTrack>();

            if (GeneratedUserBoolTracks == null)
                GeneratedUserBoolTracks = new List<TagTrackBase>();

            if (PrimaryClip != null)
            {
                if (LeftFootStepTrack == null || LeftFootStepTrack.Name == null || LeftFootStepTrack.Name == "")
                    LeftFootStepTrack = new FootStepTagTrack(0, "Footstep Left", PrimaryClip.length);

                if (RightFootStepTrack == null || RightFootStepTrack.Name == null || RightFootStepTrack.Name == "")
                    RightFootStepTrack = new FootStepTagTrack(1, "Footstep Right", PrimaryClip.length);

                if (WarpPositionTrack == null || WarpPositionTrack.Name == null || WarpPositionTrack.Name == "")
                    WarpPositionTrack = new TagTrackBase(2, "Disable Warp (Position)", PrimaryClip.length);

                if (WarpRotationTrack == null || WarpRotationTrack.Name == null || WarpRotationTrack.Name == "")
                    WarpRotationTrack = new TagTrackBase(3, "Disable Warp (Rotation)", PrimaryClip.length);

                if (EnableRootMotionTrack == null || EnableRootMotionTrack.Name == null || EnableRootMotionTrack.Name != "Disable Matching")
                    EnableRootMotionTrack = new TagTrackBase(4, "Disable Matching", PrimaryClip.length);

                if (PoseFavourTrack == null || PoseFavourTrack.Name == null || PoseFavourTrack.Name == "" )
                    PoseFavourTrack = new FloatTagTrack(5, "Pose Favour", PrimaryClip.length);

                if (WarpTrajLatTrack == null || WarpTrajLatTrack.Name == null || WarpTrajLatTrack.Name == "")
                    WarpTrajLatTrack = new TagTrackBase(6, "Disable Trajectory Warp (Angular)", PrimaryClip.length);

                if (WarpTrajLongTrack == null || WarpTrajLongTrack.Name == null || WarpTrajLongTrack.Name == "")
                    WarpTrajLongTrack = new TagTrackBase(7, "Disable Trajectory Warp (Long)", PrimaryClip.length);

                PoseFavourTrack.DefaultValue = 1f;
            }
            
            MotionModifier.OnEnable(this);

            EditorUtility.SetDirty(this);
        }
コード例 #2
0
        public void ValidateBaseData()
        {
            if (MotionModifier == null)
                MotionModifier = new MotionModifyData();

            if (TagTracks == null)
                TagTracks = new List<TagTrack>();

            if (FavourTagTracks == null)
                FavourTagTracks = new List<TagTrack>();

            if (GeneratedTagTracks == null)
                GeneratedTagTracks = new List<TagTrack>();

            if (GeneratedFavourTagTracks == null)
                GeneratedFavourTagTracks = new List<TagTrack>();

            if (m_clips == null)
                m_clips = new List<AnimationClip>();

            if (m_positions == null)
                m_positions = new List<Vector2>();

            if (m_clips != null && m_clips.Count > 0)
            {
                float clipLength = m_clips[0].length;

                if (LeftFootStepTrack == null || LeftFootStepTrack.Name == "" || LeftFootStepTrack.Name == null)
                    LeftFootStepTrack = new FootStepTagTrack(0, "Footstep Left", clipLength);

                if (RightFootStepTrack == null || RightFootStepTrack.Name == "" || RightFootStepTrack.Name == null)
                    RightFootStepTrack = new FootStepTagTrack(1, "Footstep Right", clipLength);

                if (WarpPositionTrack == null || WarpPositionTrack.Name == "" || WarpPositionTrack.Name == null)
                    WarpPositionTrack = new TagTrackBase(2, "Disable Warp (Position)", clipLength);

                if (WarpRotationTrack == null || WarpRotationTrack.Name == "" || WarpRotationTrack.Name == null)
                    WarpRotationTrack = new TagTrackBase(3, "Disable Warp (Rotation)", clipLength);

                if (EnableRootMotionTrack == null || EnableRootMotionTrack.Name == "" || EnableRootMotionTrack.Name == null)
                    EnableRootMotionTrack = new TagTrackBase(4, "Enable Root Motion", clipLength);

                if (PoseFavourTrack == null || PoseFavourTrack.Name == "" || PoseFavourTrack.Name == null)
                    PoseFavourTrack = new FloatTagTrack(5, "Pose Favour", clipLength);

                if (WarpTrajLatTrack == null || WarpTrajLatTrack.Name == null || WarpTrajLatTrack.Name == "")
                    WarpTrajLatTrack = new TagTrackBase(6, "Disable Trajectory Warp (Angular)", clipLength);

                if (WarpTrajLongTrack == null || WarpTrajLongTrack.Name == null || WarpTrajLongTrack.Name == "")
                    WarpTrajLongTrack = new TagTrackBase(7, "Disable Trajectory Warp (Long)", clipLength);

                PoseFavourTrack.SetDefaultTagValue(1f);
            }

            MotionModifier.OnEnable(this);
            EditorUtility.SetDirty(this);
        }
コード例 #3
0
        //============================================================================================
        /**
        *  @brief 
        *         
        *********************************************************************************************/
        public MotionModifyData(MotionModifyData a_copy, IMxMAnim a_targetMxMAnim)
        {
            m_targetMxMAnim = a_targetMxMAnim;

            MotionSections = new List<MotionSection>();
            foreach(MotionSection motionSection in a_copy.MotionSections)
            {
                MotionSections.Add(new MotionSection(motionSection));
            }
        }
コード例 #4
0
        public void CopyData(MxMBlendSpace a_copy)
        {
            ValidateBaseData();

            m_magnitude = a_copy.m_magnitude;
            m_smoothing = a_copy.m_smoothing;

            m_scatterSpace = a_copy.m_scatterSpace;
            m_scatterSpacing = a_copy.m_scatterSpacing;
            m_scatterPositions = null;

            UseSpeedMods = a_copy.UseSpeedMods;

            GlobalTags = a_copy.GlobalTags;
            GlobalFavourTags = a_copy.GlobalFavourTags;

            m_clips = new List<AnimationClip>(a_copy.m_clips);
            m_positions = new List<Vector2>(a_copy.Positions);

            if(m_targetPrefab == null)
                m_targetPrefab = a_copy.m_targetPrefab;

            TagTracks = new List<TagTrack>(a_copy.TagTracks.Count + 1);
            foreach(TagTrack track in a_copy.TagTracks)
            {
                TagTracks.Add(new TagTrack(track));
            }

            FavourTagTracks = new List<TagTrack>(a_copy.FavourTagTracks.Count + 1);
            foreach(TagTrack track in a_copy.FavourTagTracks)
            {
                FavourTagTracks.Add(new TagTrack(track));
            }

            UserBoolTracks = new List<TagTrackBase>(a_copy.UserBoolTracks.Count + 1);
            foreach(TagTrackBase track in a_copy.UserBoolTracks)
            {
                UserBoolTracks.Add(new TagTrackBase(track));
            }

            LeftFootStepTrack = new FootStepTagTrack(a_copy.LeftFootStepTrack);
            RightFootStepTrack = new FootStepTagTrack(a_copy.RightFootStepTrack);
            WarpPositionTrack = new TagTrackBase(a_copy.WarpPositionTrack);
            WarpRotationTrack = new TagTrackBase(a_copy.WarpRotationTrack);
            EnableRootMotionTrack = new TagTrackBase(a_copy.EnableRootMotionTrack);
            PoseFavourTrack = new FloatTagTrack(a_copy.PoseFavourTrack);
            WarpTrajLatTrack = new TagTrackBase(a_copy.WarpTrajLatTrack);
            WarpTrajLongTrack = new TagTrackBase(a_copy.WarpTrajLongTrack);

            MotionModifier = new MotionModifyData(a_copy.MotionModifier, this);
        }
コード例 #5
0
        public void CopyData(MxMAnimationClipComposite a_copy)
        {
            PrimaryClip = a_copy.PrimaryClip;
            BeforeClips = new List<AnimationClip>(a_copy.BeforeClips);
            AfterClips = new List<AnimationClip>(a_copy.AfterClips);

            Looping= a_copy.Looping;
            IgnoreEdges = a_copy.IgnoreEdges;
            ExtrapolateTrajectory = a_copy.ExtrapolateTrajectory;
            FlattenTrajectory = a_copy.FlattenTrajectory;
            RuntimeSplicing = a_copy.RuntimeSplicing;
            UseSpeedMods = a_copy.UseSpeedMods;

            GlobalTags = a_copy.GlobalTags;
            GlobalFavourTags = a_copy.GlobalFavourTags;

            TagTracks = new List<TagTrack>(a_copy.TagTracks.Count + 1);
            foreach(TagTrack track in a_copy.TagTracks)
            {
                TagTracks.Add(new TagTrack(track));
            }

            for (int i = 0; i < a_copy.TagTracks.Count; ++i)
            {
                TagTracks.Add(new TagTrack(a_copy.TagTracks[i]));
            }

            FavourTagTracks = new List<TagTrack>(a_copy.FavourTagTracks.Count + 1);
            foreach(TagTrack track  in a_copy.FavourTagTracks)
            {
                FavourTagTracks.Add(new TagTrack(track));
            }

            UserBoolTracks = new List<TagTrackBase>(a_copy.UserBoolTracks.Count + 1);
            foreach(TagTrackBase track in a_copy.UserBoolTracks)
            {
                UserBoolTracks.Add(new TagTrackBase(track));
            }

            Events = new List<EventMarker>(a_copy.Events.Count + 1);
            foreach(EventMarker marker in a_copy.Events)
            {
                Events.Add(new EventMarker(marker));
            }

            m_targetPreProcessData = a_copy.m_targetPreProcessData;
            m_targetAnimModule = a_copy.m_targetAnimModule;
            m_targetPrefab = a_copy.m_targetPrefab;

            PoseList = null;

            LeftFootStepTrack = new FootStepTagTrack(a_copy.LeftFootStepTrack);
            RightFootStepTrack = new FootStepTagTrack(a_copy.RightFootStepTrack);
            WarpPositionTrack = new TagTrackBase(a_copy.WarpPositionTrack);
            WarpRotationTrack = new TagTrackBase(a_copy.WarpRotationTrack);
            EnableRootMotionTrack = new TagTrackBase(a_copy.EnableRootMotionTrack);
            PoseFavourTrack = new FloatTagTrack(a_copy.PoseFavourTrack);
            WarpTrajLatTrack = new TagTrackBase(a_copy.WarpTrajLatTrack);
            WarpTrajLongTrack = new TagTrackBase(a_copy.WarpTrajLongTrack);

            MotionModifier = new MotionModifyData(a_copy.MotionModifier, this);
        }