I am quite new to Blender. I am writing a script for a scientific study. So I want to do it in the script change the angles of a motion in order to have quantifiable data. I have been struggling for few days to come up with a method to damp a motion of a predefined motion curve. For example:
The curves are in Quaternions. So far what I tried: Get a keyframe value w, x, y, z for the Arm and Forearm and generate a Quaternion. Then multiply each with a float value such as 0.5 (dividing by 2) to reduce the amplitude. Then update the Quaternion back.
newQat = 0.5 * (current_quat)
However, this did not quite for me. Working with Quaternion does not seem to give me the fully control the amplitude of a curve. That is at least my understanding.
Second attempt: Convert them to Euler and then multiply with a weight. For example, I want to damp the z angle of rotation of the Forearm. Then I simply, for all key frames of forearm, Get the w, x, y, z value, convert to Quaternion and then convert that to generate
OldEuler. Then generate new Euler this way:
newEuler = (OldEuler.x ,OldEuler.y, 0.5 *OldEuler.z)
Then again convert back to
newEuler.to_quaternion(), then update the curve. No great success on this method either.