Hey there Blender/Python Gurus,
i’ve got a problem with a Keyframe-Animation being generated by python.
My model is an hexapod with 3-DOF. I use blender 2.68.
I want to use the Blender-Python API to control the hexapod and simulate its walking. I’ve attach the hexapod model to this post.HexapodV1.blend (2.53 MB)
What i want to do is:
Select the hexapod-object
toggle between rigid-body dynamic and animated in the blender render. (e.g.: first insert a animated keyframe, than add a keyframe, created by the rigid-body physic of blender, and so on (for loop))
Check if there is a collision, caused by the leg rotation.
But:
After running the python script, all leg components of the hexapod show a weird position.
The python script is also in attachment. I have no idea why:(
Maybe you have a hint or idea so solve my “problem”.
Is the simulation working fine if you don’t add the keyframes?
if so, it might be that the keyframes are disturbing the simulation. Then you would first need to run the simulation, storing the locrot info in a list, and then put the locrot info in keyframes.
Thank you for your answer.
I have checked animated keyframes and solution was that i’ve miss-placed the keyframe insert code. By applying the rotation, the offset between armature origin and object origin(child of armature) caused that weird position.
There is still one problem. I can’t toggle between animation and dynamic. Either the result is only animated without any physic impact or only dynamic without any animation.
Could you explain your idea
Then you would first need to run the simulation, storing the locrot info in a list, and then put the locrot info in keyframes.
?
Anyone does this before - i mean python controlled animated physic simulation?
well, not really physics, but I regularily animate trucks, and then a script calculates how the trailers follow the truck. There i use the previous and current location of the truck and the previous location of the trailer to calculate the current position of the trailer.