Example #1
0
 public void CheckMatch(int matchObjectID, Mesh newMesh, SkinnedMeshRenderer newRenderer, string matchName, int shapeID, int objectID)
 {
     if (MatchedBlendShapes(newMesh) != 0)
     {
         for (int i = 0; i < newMesh.blendShapeCount; i++)
         {
             if (GetHumanNameMatch(newMesh.GetBlendShapeName(i)) == matchName)
             {
                 SFB_BlendMatch newBlendMatch     = new SFB_BlendMatch();
                 int            currentMatchCount = blendShapeObjects [objectID].blendShapes [shapeID].blendMatches.Count;
                 blendShapeObjects[objectID].blendShapes[shapeID].blendMatches.Add(newBlendMatch);
                 blendShapeObjects[objectID].blendShapes[shapeID].blendMatches[currentMatchCount]          = new SFB_BlendMatch();
                 blendShapeObjects[objectID].blendShapes[shapeID].blendMatches[currentMatchCount].name     = newMesh.GetBlendShapeName(i);
                 blendShapeObjects[objectID].blendShapes[shapeID].blendMatches[currentMatchCount].objectID = matchObjectID;
                 blendShapeObjects[objectID].blendShapes[shapeID].blendMatches[currentMatchCount].shapeID  = i;
             }
         }
     }
 }
Example #2
0
 public void AddMatchToNamedShape(string humanName, string matchName, int matchObjectID, int matchShapeID)
 {
     for (int o = 0; o < blendShapeObjects.Count; o++)
     {
         for (int s = 0; s < blendShapeObjects[o].blendShapes.Count; s++)
         {
             if (blendShapeObjects [o].blendShapes [s].name == humanName)
             {
                 SFB_BlendMatch newBlendMatch     = new SFB_BlendMatch();
                 int            currentMatchCount = blendShapeObjects[o].blendShapes[s].blendMatches.Count;
                 blendShapeObjects[o].blendShapes[s].blendMatches.Add(newBlendMatch);
                 blendShapeObjects[o].blendShapes[s].blendMatches[currentMatchCount]          = new SFB_BlendMatch();
                 blendShapeObjects[o].blendShapes[s].blendMatches[currentMatchCount].name     = matchName;
                 blendShapeObjects[o].blendShapes[s].blendMatches[currentMatchCount].objectID = matchObjectID;
                 blendShapeObjects[o].blendShapes[s].blendMatches[currentMatchCount].shapeID  = matchShapeID;
             }
         }
     }
 }