diff --git a/butils.py b/butils.py index 32f173e..8590d67 100644 --- a/butils.py +++ b/butils.py @@ -130,11 +130,11 @@ def align_rotations_auto_pivot(mask, input_rotations, vectors, factors, local_ma if rotation_axis.length < 1e-6: # Vectors are linearly dependent, fallback to another axis - rotation_axis = (old_axis + mathutils.Matrix().col[2]).normalized() + rotation_axis = (old_axis + mathutils.Matrix().to_3x3().col[2]).normalized() if rotation_axis.length < 1e-6: # This is now guaranteed to not be zero - rotation_axis = (-(old_axis) + mathutils.Matrix().col[1]).normalized() + rotation_axis = (-(old_axis) + mathutils.Matrix().to_3x3().col[1]).normalized() # full_angle = radians(sqrt((4 * pow(input_rotation.to_quaternion().dot(mathutils.Quaternion(vectors[i].normalized())), 2) - 3))) # dot = old_axis.dot(new_axis)