How to control hips/upper leg in avatar mask

I have a humanoid rig where I’m trying to mask off the upper body but I want the mask to include the hips/upper leg. This is for directional attack animations where they need to include some hip twist and leave the legs out of the mask so they can keep walking etc.

My understanding is the built-in avatar mask has no options to include/exclude the hips/upper leg and the only way to have control over individual bones/transforms is to change everything over to generic rig, which is a huge amount of work (all my rigs/animations etc).

Is there a way to control what bones are masked at runtime in code? Is there any API I can access?

To clarify:

  • base layer runs locomotion animations run/walk etc
  • upper body layer runs the upper body attack animations and I don’t want the legs affected, but I do want the hips affected which can’t be set in the standard humanoid avatar mask

Animator SetBoneLocalRotation(HumanBodyBones Bone , Target) - work only OnAnimator IK , for hips our legs must have IK for its pose , good if has hints knee

there’s more
Animator.bodyPosition and Animator.bodyRotation - but center mass , I think it’s better to use only little fix something in work animation pose

Circle under legs is Hips in Avatar scheme