public static void CreateWindow(ModalParent parent, LipSyncClipSetup setup, EmotionMarker marker)
        {
            MarkerSettingsWindow window = Create(parent, setup, 1);

            window.eMarker = new EmotionMarker[] { marker };

            for (int i = 0; i < setup.settings.emotions.Length; i++)
            {
                if (setup.settings.emotions[i] == marker.emotion)
                {
                    window.emotionNumber = i;
                    break;
                }
            }

            window.startTime             = marker.startTime;
            window.endTime               = marker.endTime;
            window.intensity             = marker.intensity;
            window.modifierOn            = marker.continuousVariation;
            window.maxVariationFrequency = marker.variationFrequency;
            window.intensityModifier     = marker.intensityVariation;
            window.blendableModifier     = marker.blendableVariation;
            window.boneRotationModifier  = marker.boneRotationVariation;
            window.bonePositionModifier  = marker.bonePositionVariation;

            window.modifierBool = new AnimBool(window.modifierOn, window.Repaint);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the next marker to current in a list of EmotionMarkers.
        /// </summary>
        /// <param name="list"></param>
        /// <param name="current"></param>
        /// <returns></returns>
        public static EmotionMarker NextMarker(this List <EmotionMarker> list, EmotionMarker current)
        {
            int index = list.IndexOf(current) + 1;

            if (index < list.Count)
            {
                return(list[index]);
            }
            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the previous marker to current in a list of EmotionMarkers.
        /// </summary>
        /// <param name="list"></param>
        /// <param name="current"></param>
        /// <returns></returns>
        public static EmotionMarker PreviousMarker(this List <EmotionMarker> list, EmotionMarker current)
        {
            int index = list.IndexOf(current) - 1;

            if (index >= 0)
            {
                return(list[index]);
            }
            return(null);
        }
Ejemplo n.º 4
0
        void AdjustMarkers(double newStartTime, double newLength)
        {
            // Times
            float newStartNormalised = 1 - ((setup.fileLength - (float)newStartTime) / setup.fileLength);
            float newEndNormalised   = ((float)newStartTime + (float)newLength) / setup.fileLength;

            // Adjust Marker timings (go backwards so indices don't change)
            float multiplier = 1 / (newEndNormalised - newStartNormalised);

            for (int p = setup.phonemeData.Count - 1; p >= 0; p--)
            {
                if (setup.phonemeData[p].time <newStartNormalised || setup.phonemeData[p].time> newEndNormalised)
                {
                    setup.phonemeData.RemoveAt(p);
                }
                else
                {
                    setup.phonemeData[p].time -= newStartNormalised;
                    setup.phonemeData[p].time *= multiplier;
                }
            }

            for (int g = setup.gestureData.Count - 1; g >= 0; g--)
            {
                if (setup.gestureData[g].time <newStartNormalised || setup.gestureData[g].time> newEndNormalised)
                {
                    setup.gestureData.RemoveAt(g);
                }
                else
                {
                    setup.gestureData[g].time -= newStartNormalised;
                    setup.gestureData[g].time *= multiplier;
                }
            }

            for (int e = setup.emotionData.Count - 1; e >= 0; e--)
            {
                if (setup.emotionData[e].endTime <newStartNormalised || setup.emotionData[e].startTime> newEndNormalised)
                {
                    EmotionMarker em = setup.emotionData[e];
                    setup.emotionData.Remove(em);
                    setup.unorderedEmotionData.Remove(em);
                }
                else
                {
                    setup.emotionData[e].startTime -= newStartNormalised;
                    setup.emotionData[e].startTime *= multiplier;
                    setup.emotionData[e].startTime  = Mathf.Clamp01(setup.emotionData[e].startTime);

                    setup.emotionData[e].endTime -= newStartNormalised;
                    setup.emotionData[e].endTime *= multiplier;
                    setup.emotionData[e].endTime  = Mathf.Clamp01(setup.emotionData[e].endTime);
                }
            }
        }
Ejemplo n.º 5
0
        public EmotionMarker CreateCopy()
        {
            EmotionMarker m = new EmotionMarker(emotion, startTime, endTime, blendInTime, blendOutTime, blendToMarker, blendFromMarker, customBlendIn, customBlendOut, intensity);

            m.isMixer               = isMixer;
            m.mixer                 = mixer;
            m.blendableVariation    = blendableVariation;
            m.bonePositionVariation = bonePositionVariation;
            m.boneRotationVariation = boneRotationVariation;
            m.intensityVariation    = intensityVariation;
            m.continuousVariation   = continuousVariation;

            return(m);
        }
Ejemplo n.º 6
0
        public static void CreateWindow(ModalParent parent, LipSyncClipSetup setup, EmotionMarker marker)
        {
            MarkerSettingsWindow window = Create(parent, setup, 1);

            window.eMarker = new EmotionMarker[] { marker };

            window.startTime             = marker.startTime;
            window.endTime               = marker.endTime;
            window.intensity             = marker.intensity;
            window.modifierOn            = marker.continuousVariation;
            window.maxVariationFrequency = marker.variationFrequency;
            window.intensityModifier     = marker.intensityVariation;
            window.blendableModifier     = marker.blendableVariation;
            window.boneRotationModifier  = marker.boneRotationVariation;
            window.bonePositionModifier  = marker.bonePositionVariation;

            window.modifierBool = new AnimBool(window.modifierOn, window.Repaint);
        }