Hi !
I tried to make a script that will align foot to the surface but it doesnt work correctly so
im asking for help. I was inspired by Matt_Goles to write this script and basically its a connection of 2 scripts bullet_hole.py by Social and script for moving bones by Matt_Goles :eyebrowlift:
So the script works but foots update too slow and rotate only in one direction thats the main problem. I attached an easy test scene.
Well i am a rookie so i am not the one who is going to solve your problems but I did something like that with constraints once (NO PYTHON AT ALL) however what i aligned was the object not the bones. I made a character go up and downhill with constraints only and the object rotated, but if you want more than that (and you surely do) wait for one of the Gurus here to answer you XD. Maybe i am underestimating your knowledge with this but check this blend using constraints.
You should keep the calculation relative to the objects orientation. because it works fine if you rotate left (along X) and the opposite way if you rotate right (along -X).
Your script does not care the orientation of the owner. You have to somehow include it into your calculation. I think when you calculate the rotation matrix out of the hit normal.