public void BuildTimeline() { timeline = new Timeline[settings.keyframes.values.Length + 1]; morphOriginal = new float[smrTotalBlendShapesCount]; morphTargets = new blendTarget[smrTotalBlendShapesCount]; int indexCounter = 0; for (int i = 0; i < smrTotal.Count; i++) { for (int j = 0; j < smrTotal[i].sharedMesh.blendShapeCount; j++) { morphOriginal[indexCounter] = smrTotal[i].GetBlendShapeWeight(j); morphTargets[indexCounter] = new blendTarget(); morphTargets[indexCounter].skinnedMeshRenderer = smrTotal[i]; morphTargets[indexCounter].blendShapeIndex = j; indexCounter++; } } for (int i = 0; i < settings.keyframes.values.Length; i++) { float[] slider = settings.keyframes.sliderSettings[i]; timeline[i] = new Timeline(settings.keyframes.values[i], slider); } //float[] neutralSliders = new float[smrTotalBlendShapesCount]; timeline[settings.keyframes.values.Length] = new Timeline(settings.animationTime, morphOriginal); }
public void BuildTimeline() { timeline = new Timeline[settings.keyframes.values.Length + 1]; morphOriginal = new float[smrTotalBlendShapesCount]; morphTargets = new blendTarget[smrTotalBlendShapesCount]; int indexCounter = 0; for (int i = 0; i < smrTotal.Count; i++) { for (int j = 0; j < smrTotal[i].sharedMesh.blendShapeCount; j++) { morphOriginal[indexCounter] = smrTotal[i].GetBlendShapeWeight(j); morphTargets[indexCounter] = new blendTarget(); morphTargets[indexCounter].skinnedMeshRenderer = smrTotal[i]; morphTargets[indexCounter].blendShapeIndex = j; indexCounter++; } } for (int i = 0; i < settings.keyframes.values.Length; i++) { float[] slider = settings.keyframes.sliderSettings[i]; timeline[i] = new Timeline(settings.keyframes.values[i], slider); } //float[] neutralSliders = new float[smrTotalBlendShapesCount]; timeline[settings.keyframes.values.Length] = new Timeline(settings.animationTime, morphOriginal); }