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 = mathutils.Quaternion()
q.rotate(text_properties.orientation) q.rotate(text_properties.orientation)
if regenerate: ob.rotation_quaternion = (motor[0].to_3x3() @ q.to_matrix()).to_quaternion()
obg.rotation_quaternion = q # if regenerate:
ob.rotation_quaternion = ( # obg.rotation_quaternion = q
mom.matrix_world @ motor[0] # ob.rotation_quaternion = (
).to_quaternion() # mom.matrix_world @ motor[0]
else: # ).to_quaternion()
ob.rotation_quaternion = 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: if previous_ob_rotation_mode:
ob.rotation_mode = previous_ob_rotation_mode ob.rotation_mode = previous_ob_rotation_mode