fix rotation issue

This commit is contained in:
jrkb 2025-05-14 17:21:36 +02:00
parent 19c86420f8
commit 73d7a56897

View file

@ -967,13 +967,18 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4)
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()
ob.rotation_quaternion = (motor[0].to_3x3() @ q.to_matrix()).to_quaternion()
# if regenerate:
# obg.rotation_quaternion = q
# ob.rotation_quaternion = (
# mom.matrix_world @ motor[0]
# ).to_quaternion()
# else:
# ob.rotation_quaternion = motor[0].to_quaternion()
# NOTE: supercool but out of scope, as we wouldhave to update it everytime the curve object rotates,
# but this would ignore the curve objects orientation:
# ob.rotation_quaternion = (mom.matrix_world.inverted().to_3x3() @ motor[0].to_3x3() @ q.to_matrix()).to_quaternion()
if previous_ob_rotation_mode:
ob.rotation_mode = previous_ob_rotation_mode