From 73d7a5689775fd5f7ac3f49ce833ee661f27f3bf Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Wed, 14 May 2025 17:21:36 +0200 Subject: [PATCH] fix rotation issue --- butils.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/butils.py b/butils.py index 81a03f1..9ddfba1 100644 --- a/butils.py +++ b/butils.py @@ -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