fix verbose mode

This commit is contained in:
pullusb 2025-06-17 17:18:47 +02:00
parent a5dae7ee19
commit 2868bad3da

View File

@ -18,7 +18,7 @@ def remove_stroke_exact_duplications(apply=True, verbose=True):
# TODO: Add additional check of material (even if unlikely to happen, better to avoid false positive) # TODO: Add additional check of material (even if unlikely to happen, better to avoid false positive)
ct = 0 ct = 0
if verbose: if verbose:
print('\nRemove redundant strokdes in GP frames:') print('\nRemove redundant strokdes in GP frames...')
gp_datas = [gp for gp in bpy.data.grease_pencils_v3] gp_datas = [gp for gp in bpy.data.grease_pencils_v3]
for gp in gp_datas: for gp in gp_datas:
for l in gp.layers: for l in gp.layers:
@ -36,6 +36,7 @@ def remove_stroke_exact_duplications(apply=True, verbose=True):
if apply and idx_to_delete: if apply and idx_to_delete:
# Remove redundancy (carefull, passing an empty list delete all strokes) # Remove redundancy (carefull, passing an empty list delete all strokes)
if verbose:
print(f"{gp.name} > {l.name} > {f_id}: {len(idx_to_delete)} strokes") print(f"{gp.name} > {l.name} > {f_id}: {len(idx_to_delete)} strokes")
f.drawing.remove_strokes(indices=idx_to_delete) f.drawing.remove_strokes(indices=idx_to_delete)
return ct return ct