top of page

Batch Renaming by Selection

This script renames selected objects in Blender with a base name and sequential numbering, ensuring consistent and organized object names.

Batch Renaming by Selection

Broken button... I'll fix it eventually...

import bpy


# Base name for the objects

base_name = "Scribble Lines"


# Start number

start_number = 1


# Get selected objects

selected_objects = bpy.context.selected_objects


# Sort objects by their names to ensure a consistent renaming order

sorted_objects = sorted(selected_objects, key=lambda obj: obj.name)


# Rename each object

for index, obj in enumerate(sorted_objects):

    obj.name = f"{base_name} - {start_number + index}"


print(f"Renamed {len(selected_objects)} objects to '{base_name} - N' format.")


Description

This script renames all selected objects in Blender with a consistent base name followed by a sequential number. It first sorts the selected objects by their current names to ensure a predictable renaming order. Each object is then assigned a new name in the format <Base Name> - <Number>, starting with a user-defined initial number.

bottom of page