예제 #1
0
        void OnEnable()
        {
            m_Character                      = serializedObject.FindProperty("m_Character");
            m_VerboseLogging                 = serializedObject.FindProperty("m_VerboseLogging");
            m_TrackingLossPadding            = serializedObject.FindProperty("m_TrackingLossPadding");
            m_BlendShapesControllerOverride  = serializedObject.FindProperty("m_BlendShapesControllerOverride");
            m_CharacterRigControllerOverride = serializedObject.FindProperty("m_CharacterRigControllerOverride");
            m_HeadBoneOverride               = serializedObject.FindProperty("m_HeadBoneOverride");
            m_CameraOverride                 = serializedObject.FindProperty("m_CameraOverride");
            m_StreamSourceOverrides          = serializedObject.FindProperty("m_StreamSourceOverrides");

            var streamReader = (StreamReader)target;

            streamReader.ConnectDependencies();
            foreach (var source in streamReader.sources)
            {
                var network = source as NetworkStream;
                if (network != null)
                {
                    m_NetworkStream = network;
                }

                var playback = source as PlaybackStream;
                if (playback != null)
                {
                    m_PlaybackStream = playback;
                }
            }
        }
예제 #2
0
        public ClipBaker(AnimationClip clip, StreamReader streamReader, PlaybackStream playbackStream,
                         BlendShapesController blendShapesController, CharacterRigController characterRigController, string filePath)
        {
            m_Clip                   = clip;
            m_StreamReader           = streamReader;
            m_PlaybackStream         = playbackStream;
            m_BlendShapesController  = blendShapesController;
            m_CharacterRigController = characterRigController;
            m_FilePath               = filePath;

            StartClipBaker(m_BlendShapesController != null
                ? m_BlendShapesController.transform
                : m_CharacterRigController.transform);
        }
예제 #3
0
        static void ShowRecordStreamMenu(PlaybackStream playbackStream, PlaybackBuffer[] buffers)
        {
            var menu = new GenericMenu();

            foreach (var buffer in buffers)
            {
                if (buffer.recordStream == null || buffer.recordStream.Length < 1)
                {
                    continue;
                }

                var label          = new GUIContent(buffer.name);
                var playbackBuffer = buffer;
                var isActive       = playbackStream.activePlaybackBuffer == playbackBuffer;
                menu.AddItem(label, isActive, () => playbackStream.SetPlaybackBuffer(playbackBuffer));
            }

            menu.ShowAsContext();
            Event.current.Use();
        }