BoneFootprint.txt (722 Bytes)
I have the script which is meant to create an empty based on selected pose bone. The part starting from line 14 (“align empty to bone”) doesn’t work in 2.9 and higher, even if similar code worked in 2.79. More, it actually resets the empty’s location to zero
#align empty to bone
mat = bone.matrix
wmat = _me.matrix_world
bpy.context.active_object.matrix_world = wmat * mat#apply bone rotation to empty
Note that mat_a *= mat_b did not change the original matrix, now in 2.8 it does (matching other types - Vector and Python lists for example).
Noting this since it could be a breaking change for scripts that relied on it creating a new matrix, especially if in cases where a matrix is passed as a function argument and changed to it aren’t expected.