public void SetEyeShapeTables(List <EyeShapeTable_v2> eyeShapeTables) { bool valid = true; if (eyeShapeTables == null) { valid = false; } else { for (int table = 0; table < eyeShapeTables.Count; ++table) { if (eyeShapeTables[table].skinnedMeshRenderer == null) { valid = false; break; } for (int shape = 0; shape < eyeShapeTables[table].eyeShapes.Length; ++shape) { EyeShape_v2 eyeShape = eyeShapeTables[table].eyeShapes[shape]; if (eyeShape > EyeShape_v2.Max || eyeShape < 0) { valid = false; break; } } } } if (valid) { EyeShapeTables = eyeShapeTables; } }
private void RenderModelEyeShape(EyeShapeTable_v2 eyeShapeTable, Dictionary <EyeShape_v2, float> weighting) { for (int i = 0; i < eyeShapeTable.eyeShapes.Length; ++i) { EyeShape_v2 eyeShape = eyeShapeTable.eyeShapes[i]; if (eyeShape > EyeShape_v2.Max || eyeShape < 0) { continue; } if (eyeShape == EyeShape_v2.Eye_Left_Blink || eyeShape == EyeShape_v2.Eye_Right_Blink) { eyeShapeTable.skinnedMeshRenderer.SetBlendShapeWeight(i, weighting[eyeShape] * 100f); } else { AnimationCurve curve = EyebrowAnimationCurves[(int)eyeShape]; eyeShapeTable.skinnedMeshRenderer.SetBlendShapeWeight(i, curve.Evaluate(weighting[eyeShape]) * 100f); } } }