コード例 #1
0
ファイル: Faceshift.cs プロジェクト: Eddy002/SCARYGAME
        //! Loads the t pose of the character.
        public bool LoadTPoseFromAsset(TextAsset asset)
        {
            TPose new_tpose = new TPose();

            if (new_tpose.loadFromBytes(asset.bytes))
            {
                m_tpose       = new_tpose;
                m_tpose_asset = asset;
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        void Start()
        {
            m_mutex = new Mutex();

            m_data_parser   = new DataParser();
            m_current_track = new TrackData();

            m_connection = new NetworkConnection(this);
            if (!m_connection.Start(hostName, port, true))
            {
                Debug.LogError("could not access faceshift over the network on " + hostName + ":" + port + " using the TCP/IP protocol");
            }

            // get the blendshapes from fs studio
            askForBlendshapeNames();

            if (RetargetingAsset != null)
            {
                m_retargeting = ClipRetargeting.load(RetargetingAsset.bytes);
                if (m_retargeting == null)
                {
                    Debug.LogError("could not load retargeting from asset");
                }
            }

            if (TPoseAsset != null)
            {
                m_tpose = new TPose();
                if (!m_tpose.loadFromBytes(TPoseAsset.bytes))
                {
                    Debug.LogError("could not load tpose from asset");
                }
            }

            // get game object blendshapes and transformations
            Utils.getGameObjectBlendshapes(gameObject, m_game_object_blendshapes);
            Utils.getGameObjectTransformations(gameObject, m_game_object_transformations);
        }