Skip to content

Commit

Permalink
fix regex in sub remove end numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
Pullusb committed Apr 3, 2024
1 parent f14da42 commit 76bb20c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snippets/regex/sub_remove_object_and_data_end_numbering.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def rename_data(ob):
return

# else just try to rmeove number in name
new = re.sub(r'(.\d{3})$', '', dt.name)
new = re.sub(r'\.\d{3}$', '', dt.name)
if dt.name != new:
if not new in datagroup:
print(f'{dt.rna_type.identifier} data: {dt.name} >> {new}')
Expand All @@ -42,7 +42,7 @@ def remove_end_numbering(ob, data_rename=True, skip_multi_user_objs=False):
# rename_data(ob)
return

new = re.sub(r'(.\d{3})$', '', ob.name)
new = re.sub(r'\.\d{3}$', '', ob.name)
if ob.name != new and not new in bpy.context.scene.objects:
print(f'{ob.name} >> {new}')
ob.name = new
Expand Down

0 comments on commit 76bb20c

Please sign in to comment.