fix ignore_orientation
This commit is contained in:
parent
8609db1597
commit
c95e010f81
1 changed files with 17 additions and 25 deletions
42
butils.py
42
butils.py
|
@ -950,33 +950,25 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4)
|
||||||
else:
|
else:
|
||||||
ob.location = location + text_properties.translation
|
ob.location = location + text_properties.translation
|
||||||
|
|
||||||
if not text_properties.ignore_orientation:
|
# orientation / rotation
|
||||||
mask = [0]
|
mask = [0]
|
||||||
input_rotations = [mathutils.Vector((0.0, 0.0, 0.0))]
|
input_rotations = [mathutils.Vector((0.0, 0.0, 0.0))]
|
||||||
vectors = [tangent]
|
vectors = [tangent]
|
||||||
factors = [1.0]
|
factors = [1.0]
|
||||||
local_main_axis = mathutils.Vector((1.0, 0.0, 0.0))
|
local_main_axis = mathutils.Vector((1.0, 0.0, 0.0))
|
||||||
motor = align_rotations_auto_pivot(
|
motor = align_rotations_auto_pivot(
|
||||||
mask, input_rotations, vectors, factors, local_main_axis
|
mask, input_rotations, vectors, factors, local_main_axis
|
||||||
)
|
) if not text_properties.ignore_orientation else [mathutils.Matrix()]
|
||||||
|
|
||||||
q = mathutils.Quaternion()
|
q = mathutils.Quaternion()
|
||||||
q.rotate(text_properties.orientation)
|
q.rotate(text_properties.orientation)
|
||||||
if regenerate:
|
if regenerate:
|
||||||
obg.rotation_quaternion = q
|
obg.rotation_quaternion = q
|
||||||
ob.rotation_quaternion = (
|
ob.rotation_quaternion = (
|
||||||
mom.matrix_world @ motor[0]
|
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()
|
|
||||||
).to_quaternion()
|
).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:
|
if previous_ob_rotation_mode:
|
||||||
ob.rotation_mode = previous_ob_rotation_mode
|
ob.rotation_mode = previous_ob_rotation_mode
|
||||||
|
|
Loading…
Add table
Reference in a new issue