//! @brief Loads a faceshift clip public void LoadFSB(string path) { if (!File.Exists(path)) { #if UNITY_EDITOR EditorUtility.DisplayDialog("Clip loading failed", "File " + path + " does exist", "Ok"); #endif return; } Clip new_clip = FsbReader.Read(path); if (new_clip == null) { Debug.LogError("could not read clip from file " + path); #if UNITY_EDITOR EditorUtility.DisplayDialog("Load failed", "File " + path + " does not contain a clip", "Ok"); #endif return; } Rig clip_rig = new_clip.Rig(); if (IsSourceRigDifferent(clip_rig)) { if ((cachedRigLoaded) && (!SourceRigChangedAskToContinue())) { // The user wants to cancel return; } } // always save new rig from the fsb file to have the same order // Apply new rig m_fs_Rig = clip_rig; // Cache new rig SaveSourceRig(); m_clip = new_clip; m_clip_path = path; }
//! @brief Loads a faceshift clip public void LoadFSB(string path) { if (!File.Exists(path)) { #if UNITY_EDITOR EditorUtility.DisplayDialog("Clip loading failed", "File " + path + " does exist", "Ok"); #endif return; } Clip new_clip = FsbReader.read(path); if (new_clip == null) { Debug.LogError("could not read clip from file " + path); #if UNITY_EDITOR EditorUtility.DisplayDialog("Load failed", "File " + path + " does not contain a clip", "Ok"); #endif return; } Rig clip_rig = new_clip.rig(); if (!clip_rig.Equals(m_fs_Rig)) { if ((cachedRigLoaded) && (!source_rig_changed_ask_to_continue())) { // The user wants to cancel return; } // Apply new rig m_fs_Rig = clip_rig; // Cache new rig SaveSourceRig(); } m_clip = new_clip; m_clip_path = path; }