import pymel.core as pm
On the original issue, the spring solver, and rp solver are different methods for solving ik. RP solvers are RotatePlane solver, needing guidance to know what plane to bend in. Good for Biped arms and legs. The Spring solver is for more than “one knee”, behaviors, like a dog, where you want to control the internal angle of the knee and ankle for tension, not just its arrival at the end goal.
The python vs mel implementation of the solvers is irrelevant, and doesn’t change the solver’s behavior. Any change would be a result of user error in selection order, or flags.
If you aren’t animating the preferred angle attribute of the joints, a poleVector constraint will solve the flipping.
Everytime I’ve tried to use that spring solver for what its suppose to do, I get burned somewhere else down the line with how it behaves. Mainly in that if any aspect of its controls are in the same hierarchy, its easy to get double transform behavior out of the chain.
My non spring solver solution