Anim: name new action slots after the last-used slot

When creating a new action slot for a data-block, via the '+ New' button
of the slot selector, use the name of the slot that was last used by
that data-block. Previously, it would always use the name of the
data-block, interfering with slot auto-selection when toggling between
Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/138326
This commit is contained in:
Sybren A. Stüvel
2025-05-02 16:03:00 +02:00
parent a5834743f3
commit f6167aab31

View File

@@ -712,7 +712,8 @@ class ANIM_OT_slot_new_for_id(Operator):
if adt.action_slot:
slot = adt.action_slot.duplicate()
else:
slot = adt.action.slots.new(animated_id.id_type, animated_id.name)
slot_name = adt.last_slot_identifier[2:] or animated_id.name
slot = adt.action.slots.new(animated_id.id_type, slot_name)
adt.action_slot = slot
return {'FINISHED'}