detect textobject and allow primitive duplication

This commit is contained in:
jrkb 2025-05-25 20:36:46 +02:00
parent 10e57dd46a
commit 88cfaf3be7
2 changed files with 151 additions and 28 deletions

View file

@ -137,9 +137,12 @@ class ABC3D_glyph_properties(bpy.types.PropertyGroup):
def update_callback(self, context):
if self.text_id >= 0:
butils.set_text_on_curve(
context.scene.abc3d_data.available_texts[self.text_id]
)
# butils.set_text_on_curve(
# context.scene.abc3d_data.available_texts[self.text_id]
# )
t = butils.get_text_properties(self.text_id)
if t is not None:
butils.set_text_on_curve(t)
glyph_id: bpy.props.StringProperty(maxlen=1)
text_id: bpy.props.IntProperty(
@ -259,6 +262,7 @@ class ABC3D_text_properties(bpy.types.PropertyGroup):
)
distribution_type: bpy.props.StringProperty()
glyphs: bpy.props.CollectionProperty(type=ABC3D_glyph_properties)
actual_text: bpy.props.StringProperty()
class ABC3D_data(bpy.types.PropertyGroup):
@ -1942,8 +1946,8 @@ def on_depsgraph_update(scene, depsgraph):
print(" updated geometry is true")
print(f" is {len(scene.abc3d_data.available_texts)} bigger than {text_id=} is true?")
# butils.detect_texts()
if len(scene.abc3d_data.available_texts) > text_id:
text_properties = scene.abc3d_data.available_texts[text_id]
text_properties = butils.get_text_properties(text_id)
if text_properties is not None:
print(" YES")
print(f" is ? {text_properties.text_object.name=} is {u.id.name=}")
if text_properties.text_object == u.id.original: