I’m writing a script that generates key frames for actions on armatures. Right now the actions are a bit extreme, and I’d like to make things a bit smoother by interpolating the value I’m calculating for the pose with the rest pose of the bone. Where can I get this from? bpy.types.Bone and bpy.types.PoseBone don’t have anything that looks obviously like the a rest position matrix.
To provide the armature with a softer movement by interpolating with the rest pose, you can use the matrix_local
feature included in bpy.types.Bone
. This feature also serves to transition the transformation from review to actuation in the rest state.
Python
import bpy
Using your armature object name and the bone name you placed down, you can create constraints on the selected bones using the Constraint menu.
bone = bpy.data.armatures[‘armature’].bones[‘bone_name’]
rest_pose_matrix = bone.matrix_local
rest_pose_matrix
will provide you with a bone’s rest position matrix, with which you can interpolate upon the current pose value, so you could achieve a better quality of motion normalization.
1 Like