How can I fix the issue where the model becomes distorted and folded after binding bones with Base IK?

I converted this MMD model to FBX in Blender and then imported it into Unreal Engine 5.8.3. I want to rig her with IK and then animate her. When using Basic IK to bind the leg bones, I found that for some reason the legs would twist abnormally, and in severe cases they would even twist into the shape of the number 3. I tried adjusting the primary axis and secondary axis parameters, but it didn’t help much. In this attempt, I also found that the foot mesh had disappeared again, which is very strange.
I checked, and the bones used by Basic IK are the thigh, shin, and foot, which are in a continuous parent-child hierarchy. The effector is the foot control point, and the pole vector uses a newly created shin control point. However, the twisting appears as soon as I bind those three bones. No matter how I change the primary and secondary axes, I can’t get it back to normal, and there are too many combinations to try one by one.
Has anyone run into this before? Any idea why the legs twist like this and why the foot mesh disappears? How can I fix it? Any help would be much appreciated!

That twisted “3” shape right at bind time is usually an axis mismatch, not something you can fix by trying every Primary/Secondary combination. MMD skeletons exported through Blender often have bone local axes that don’t match what Basic IK assumes.

Checks, in order:

  1. In the Control Rig editor, enable bone axes display. The axis that runs from the knee toward the ankle is your Primary Axis. The axis pointing out in front of the knee is the Secondary Axis.
  2. Keep the Pole Vector control outside the leg chain (parent it to the root or a Controls group, not to the shin). Place it directly in front of the knee, not on the thigh-to-foot line, or the knee will flip.
  3. MMD legs often include IK and toe-IK bones and a twist bone. Only put the real deforming thigh and shin in the chain, and use the ankle as the effector.
  4. If the foot disappears, check the foot bone’s Scale while the rig runs. Negative or near-zero scale makes the skin get culled. Turning off Stretch is a quick test.
  5. If it still fights you, fix the roll in Blender so each bone’s Y points to its child, or use an IK Rig with a Limb solver instead.