Page 1 of 1
Controling armature articulation in gameEngine w pyhton?
Posted: Thu Dec 12, 2002 11:10 pm
Does anybody have any advice on how to program inverse kenematics into the game engine. I'm about halfway through an extensive book on python and I'm wondering if I can even access the positions of armature with python in the game engine or weather it would require lower level C programming skills, I'm also starting to look at the University of pennsylvainia paper on the subject of inverse kenematics. Am I approaching this the right way?
Posted: Sat Dec 14, 2002 8:02 pm
Short answer: will take at least some c programming to modify the game engine to allow this.
Version 2.25 has a setChannel() method for the action actuator, so you can set relative position and orientation of a bone. I haven't fully tested it yet, but if it works it would give you a big advantage. However, to do IK you are going to need to find out where in world coordinates your bone or target is, so you can compute what setChannel callls are needed to bring it close to the target. I don't think that is possible now since there is no getChannel() that would give you at least a start. Looking at the code, this was planned but not finished.
However, the good thing is that you should be able to add the necessary functions in the game engine because the game engine uses the armature objects "directly", i.e. very little translation between the IK system in regular blender and real-time. In fact, I don't see why one couldn't readily run the IK system in the game engine. Would slow things down a bunch, but perhaps there are settings that could make this do-able for simple chains.
Posted: Sat Dec 14, 2002 8:48 pm
Can you get armature/bone positions from one of the non-interactive Blender modules? You can use the non-interactive modules just fine in gameblender for reading information, the problem is if you try to use them to change something, you have to restart the scene for changes to have effect. But if you can get the armature info from somewhere in the Blender module, you might be able to get it going with setChannel...