From 2166a8e0d8f28437e6db05dcf9eb325b4ea54b21 Mon Sep 17 00:00:00 2001 From: suzuryg Date: Sun, 12 Mar 2023 22:29:39 +0900 Subject: [PATCH] Add AacFlClip.BlendShape() overload --- .../V1/Editor/AacFlAnimations.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs index 32a5bd8..f614eb3 100644 --- a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs +++ b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs @@ -78,6 +78,15 @@ namespace AnimatorAsCode.V1 return this; } + public AacFlClip BlendShape(SkinnedMeshRenderer renderer, string blendShapeName, AnimationCurve animationCurve) + { + var binding = AacV0.Binding(_component, typeof(SkinnedMeshRenderer), renderer.transform, $"blendShape.{blendShapeName}"); + + AnimationUtility.SetEditorCurve(Clip, binding, animationCurve); + + return this; + } + public AacFlClip Scaling(GameObject[] gameObjectsWithNulls, Vector3 scale) { var defensiveObjects = gameObjectsWithNulls.Where(o => o != null); // Allow users to remove an item in the middle of the array