reset rotation mode
This commit is contained in:
parent
d13afa7d7d
commit
36c8f25e29
1 changed files with 14 additions and 4 deletions
18
butils.py
18
butils.py
|
@ -821,6 +821,15 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4)
|
||||||
ob.constraints["Follow Path"].up_axis = "UP_Y"
|
ob.constraints["Follow Path"].up_axis = "UP_Y"
|
||||||
spline_index = 0
|
spline_index = 0
|
||||||
elif distribution_type == 'CALCULATE':
|
elif distribution_type == 'CALCULATE':
|
||||||
|
previous_ob_rotation_mode = None
|
||||||
|
previous_obg_rotation_mode = None
|
||||||
|
if ob.rotation_mode != 'QUATERNION':
|
||||||
|
ob.rotation_mode = 'QUATERNION'
|
||||||
|
previous_ob_rotation_mode = ob.rotation_mode
|
||||||
|
if obg.rotation_mode != 'QUATERNION':
|
||||||
|
obg.rotation_mode = 'QUATERNION'
|
||||||
|
previous_obg_rotation_mode = obg.rotation_mode
|
||||||
|
|
||||||
location, tangent, spline_index = calc_point_on_bezier_curve(mom, advance, True, True)
|
location, tangent, spline_index = calc_point_on_bezier_curve(mom, advance, True, True)
|
||||||
if spline_index != previous_spline_index:
|
if spline_index != previous_spline_index:
|
||||||
is_newline = True
|
is_newline = True
|
||||||
|
@ -846,10 +855,7 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4)
|
||||||
vectors,
|
vectors,
|
||||||
factors,
|
factors,
|
||||||
local_main_axis)
|
local_main_axis)
|
||||||
if ob.rotation_mode != 'QUATERNION':
|
|
||||||
ob.rotation_mode = 'QUATERNION'
|
|
||||||
if obg.rotation_mode != 'QUATERNION':
|
|
||||||
obg.rotation_mode = 'QUATERNION'
|
|
||||||
q = mathutils.Quaternion()
|
q = mathutils.Quaternion()
|
||||||
q.rotate(text_properties.orientation)
|
q.rotate(text_properties.orientation)
|
||||||
if regenerate:
|
if regenerate:
|
||||||
|
@ -864,6 +870,10 @@ def set_text_on_curve(text_properties, reset_timeout_s=0.1, reset_depsgraph_n=4)
|
||||||
obg.rotation_quaternion = (mom.matrix_world @ q.to_matrix().to_4x4()).to_quaternion()
|
obg.rotation_quaternion = (mom.matrix_world @ q.to_matrix().to_4x4()).to_quaternion()
|
||||||
# ob.rotation_quaternion = (mom.matrix_world @ q.to_matrix().to_4x4()).to_quaternion()
|
# ob.rotation_quaternion = (mom.matrix_world @ q.to_matrix().to_4x4()).to_quaternion()
|
||||||
|
|
||||||
|
if previous_ob_rotation_mode:
|
||||||
|
ob.rotation_mode = previous_ob_rotation_mode
|
||||||
|
if previous_obg_rotation_mode:
|
||||||
|
obg.rotation_mode = previous_obg_rotation_mode
|
||||||
|
|
||||||
glyph_advance = get_glyph_advance(glyph) * scalor + text_properties.letter_spacing
|
glyph_advance = get_glyph_advance(glyph) * scalor + text_properties.letter_spacing
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue