Our game has an extensive dictionary of models and animations, which have worked fine up until an animation was created using forward kinematics up until a certain point, and then over a span of frames the controls for a few joints switched to inverse kinematics.
After running maya2egg7, using all the same flags that worked fine on the other animations, the resulting egg shows the joints that switch to IK getting terribly deformed. It’s ugly. Not what it’s supposed to do. We’ve tried just an abrupt switch from FK to IK, but all that did was cause the ugly deformation to happen faster.
These were created in maya 7, and we’re currently using panda 1.3.2. I am not using controlJoint, just relying on the pre-generated animation.
So, this is what I understand: Panda3D has no physics engine for Inverse Kinematics, however (from the manual):
Does this mean that it has to be all IK or all FK? Is there some other way to work around this quirky behavior? Is there a specific module I can update that would fix this? Or perhaps a savvy way to export these files to egg that would just not care which method is used?
Any information regarding inverse kinematics and panda’s pipeline would be helpful.
Panda doesn’t know anything about IK or FK. It just asks Maya for the joint angles each frame, and records that information. Thus, if your animation is gettings screwed up between the IK / FK transition, it must be a Maya problem, not directly related to Panda.
Try using the “-a pose” option to maya2egg to extract a particular troublesome frame. If the “-a pose” model is screwed up too, you’re completely hosed, since that mode is just asking Maya for all of the vertex positions directly.
If, on the other hand, “-a pose” is good, but the normal “-a chan” and “-a model” is broken, then it’s a more subtle problem. In the normal mode, maya2egg asks for the vertex positions and joint angles in the “neutral” pose, and then asks for the joint angles in the selected frame, and moves the vertices according to the new joint angles. You might try using the -nf option to specify a different “neutral” or rest pose.
The result of -a pose is what I expect it to look like, so I guess it’s no surprise that maya is probably to blame.
I don’t quite see how the -nf flag would help in this situation, since the model never ‘rests’, it is always either playing an ‘idle’ animation or something else.
Perhaps the solution is to secretly play 2 animations, one which is entirely FK, one which is entirely IK, since I’ve only noticed this strange quirk when a single file transitions between the two methods.
Thanks for your timely response!
The neutral or rest pose is the pose of the model when all of its joints are in the neutral position. Every model has a rest pose, and it is the starting position from which all the other animations are computed. The selection of the rest pose can have an enormous effect on the quality of the resulting animation.
And that it has!
Thanks a billion. Problem solved.