예제 #1
0
 private void FindAndSyncCap()
 {
     CoreMesh[] meshes = gameObject.GetComponentsInChildren <CoreMesh>(true);
     foreach (CoreMesh mesh in meshes)
     {
         if (mesh.name.Contains("_LOD") == false && mesh.name.Contains("_CAP") == true)
         {
             cap = mesh;
             //resync blendshapes as needed
             if (blendshape_cache.Keys != null)
             {
                 foreach (string bs in blendshape_cache.Keys)
                 {
                     cap.SetUnityBlendshapeWeight(bs, blendshape_cache[bs]);
                 }
             }
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Overridden method to set a blendshape weight given a DisplayName
        /// </summary>
        /// <returns>true</returns>
        /// <c>false</c>
        /// <param name="displayName">Display name.</param>
        /// <param name="newValue">New value.</param>
        override public bool SetUnityBlendshapeWeight(string id, float newValue)
        {
//			Debug.Log("GBLENDNDNDF");
//			DetectCoreMeshes();
            blendshape_cache[id] = newValue;
            foreach (CoreMesh mesh in LODlist)
            {
//				Debug.Log("$($");
                mesh.SetUnityBlendshapeWeight(id, newValue);
            }
            if (cap != null)
            {
                cap.SetUnityBlendshapeWeight(id, newValue);
            }
            if (feathered != null)
            {
                feathered.SetUnityBlendshapeWeight(id, newValue);
            }
            if (opaque != null)
            {
                opaque.SetUnityBlendshapeWeight(id, newValue);
            }
            return(true);
        }