You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a modal operator that lets users explicitly define the numbering order for batch-renaming by clicking objects one by one.
Motivation
The previous "Sort by Selection" feature (removed in #248) tracked selection order automatically via a depsgraph handler. That approach was rejected by the Blender extension platform for performance and stability reasons. This operator replaces it with an explicit, user-driven workflow.
The underlying need remains: bpy.context.selected_objects does not preserve selection order, and axis-based sorting (X/Y/Z) does not cover all cases — for example a curved spine chain where anatomical order does not align with any world axis.
Proposed workflow
User enables Sort in the renaming panel and selects "Selection" as the sort mode
A "Select in Renaming Order" button appears
User clicks the button to activate the modal
Viewport header shows: "Click objects in order (N selected) — Enter to confirm, Esc to cancel"
User clicks objects one by one in the desired numbering order; each clicked object is selected and assigned an internal order index
User confirms with Enter (or cancels with Esc/Right-click)
User runs the rename/numerate operator — objects are numbered in the clicked order
Implementation notes
Modal operator class OBJECT_OT_select_in_renaming_order
Use bpy_extras.view3d_utils + scene.ray_cast() to identify the object under the cursor
Consume LEFTMOUSE events to prevent Blender's own selection from interfering
Pass all other events through so viewport navigation (orbit, pan, zoom) keeps working
Store order as a selection_order custom property on each object (same storage as the old feature)
Cancel clears all assigned order properties and deselects objects
The platform reviewer was informed of this plan and asked whether a modal operator approach would be acceptable. This ticket should be started once that is confirmed.
Summary
Add a modal operator that lets users explicitly define the numbering order for batch-renaming by clicking objects one by one.
Motivation
The previous "Sort by Selection" feature (removed in #248) tracked selection order automatically via a depsgraph handler. That approach was rejected by the Blender extension platform for performance and stability reasons. This operator replaces it with an explicit, user-driven workflow.
The underlying need remains:
bpy.context.selected_objectsdoes not preserve selection order, and axis-based sorting (X/Y/Z) does not cover all cases — for example a curved spine chain where anatomical order does not align with any world axis.Proposed workflow
Implementation notes
OBJECT_OT_select_in_renaming_orderbpy_extras.view3d_utils+scene.ray_cast()to identify the object under the cursorLEFTMOUSEevents to prevent Blender's own selection from interferingselection_ordercustom property on each object (same storage as the old feature)Platform confirmation needed
The platform reviewer was informed of this plan and asked whether a modal operator approach would be acceptable. This ticket should be started once that is confirmed.
Related: #248, #115, #239