How to set FK/IK Blend by code (UMotion API)
Dear Peter,
I'm trying to standardize the feet placement of about 150 mocapped gesture animations. Through the UMotion API I'm able to set the position and rotation of the IK_Foot_X objects but by default, the FK/IK Blend slider is set to 0.
When I request all the custom constraints by GetCustomPropertyConstraintNames I get an empty list. The feet IK have been set up by the IK Setup Wizard and the project is Humanoid.
Is there a way to set the FK/IK blend slider by code so I can automate adjustments and export them all at once?
Example code:
var targetObject = GameObject.Find("rp_sophia_animated_003_idling_ball_l").transform;
PoseEditor.TrySetFkLocalRotation(targetObject, Quaternion.Euler(0f, 0f, 90f), "rotate ball L", false);
targetObject = GameObject.Find("rp_sophia_animated_003_idling_ball_r").transform;
PoseEditor.TrySetFkLocalRotation(targetObject, Quaternion.Euler(0f, 0f, 90f), "rotate ball R", false);
targetObject = GameObject.Find("IK_Foot_R").transform;
var IKFootRPosition = new Vector3(0.08681f, 0.08425f, 1.64067f);
PoseEditor.TrySetFkWorldPosition(targetObject, IKFootRPosition, "IK Foot R Pos", false);
var IKFootRRotation = Quaternion.Euler(1.8f, 277.1f, 89.4f);
PoseEditor.TrySetFkWorldRotation(targetObject, IKFootRRotation, "IK Foot R Rot", false);
List names = new List();
PoseEditor.GetCustomPropertyConstraintNames(targetObject, names);
Debug.Log($"{targetObject.name} names count: {names.Count}");
Customer support service by UserEcho