I got a problem here.
Here is the question: "Given a leg with animation in maya, how can I correct mid joint of leg to avoid broken, but keep three joints at the same position as the one in original animation? It can only change the rotation value of root joint, mid joint, end joint. And only use code and math in python."
While, I was thinking, reset rotateX and rotateY of mid joint to 0 could fix the leg broken. BUT it will change the end joint position compared to the original animation. So, I was thinking is there a way to calculate the rotation values for the root joint and mid joint that would keep the three joints in the same position as the original animation?
I appreciate it if anyone can help me.