fix rotation issue
This commit is contained in:
parent
19c86420f8
commit
73d7a56897
1 changed files with 12 additions and 7 deletions
19
butils.py
19
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
|
||||
|
|
Loading…
Add table
Reference in a new issue