diff --git a/butils.py b/butils.py index b6e51f6..1c4e0c3 100644 --- a/butils.py +++ b/butils.py @@ -950,33 +950,25 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4) else: ob.location = location + text_properties.translation - if not text_properties.ignore_orientation: - mask = [0] - input_rotations = [mathutils.Vector((0.0, 0.0, 0.0))] - vectors = [tangent] - factors = [1.0] - local_main_axis = mathutils.Vector((1.0, 0.0, 0.0)) - motor = align_rotations_auto_pivot( - mask, input_rotations, vectors, factors, local_main_axis - ) + # orientation / rotation + mask = [0] + input_rotations = [mathutils.Vector((0.0, 0.0, 0.0))] + vectors = [tangent] + factors = [1.0] + local_main_axis = mathutils.Vector((1.0, 0.0, 0.0)) + motor = align_rotations_auto_pivot( + mask, input_rotations, vectors, factors, local_main_axis + ) if not text_properties.ignore_orientation else [mathutils.Matrix()] - q = mathutils.Quaternion() - q.rotate(text_properties.orientation) - if regenerate: - obg.rotation_quaternion = q - ob.rotation_quaternion = ( - mom.matrix_world @ motor[0] - ).to_quaternion() - else: - ob.rotation_quaternion = motor[0].to_quaternion() - else: - q = mathutils.Quaternion() - q.rotate(text_properties.orientation) - # obg.rotation_quaternion = q - obg.rotation_quaternion = ( - mom.matrix_world @ q.to_matrix().to_4x4() + q = mathutils.Quaternion() + q.rotate(text_properties.orientation) + if regenerate: + obg.rotation_quaternion = q + ob.rotation_quaternion = ( + mom.matrix_world @ motor[0] ).to_quaternion() - # ob.rotation_quaternion = (mom.matrix_world @ q.to_matrix().to_4x4()).to_quaternion() + else: + ob.rotation_quaternion = motor[0].to_quaternion() if previous_ob_rotation_mode: ob.rotation_mode = previous_ob_rotation_mode