d00e6e7353
Like with NLA strips, Action assignment on Action Constraints needs to have an extra step (compared to regular assignment to animated data-blocks). For the Action Constraint, the auto slot selection gets one more fallback option (compared to the generic code). This is to support the following scenario, which used to be necessary as a workaround for a bug in Blender (#127976): - Python script creates an Action, - assigns it to the animated object, - unassigns it from that object, - and assigns it to the object's Action Constraint. The generic code doesn't work for this. The first assignment would see the slot `XXSlot`, and because it has never been used, just use it. This would change its name to `OBSlot`. The assignment to the Action Constraint would not see a 'virgin' slot, and thus not auto-select `OBSlot`. This behaviour makes sense when assigning Actions in the Action editor (it shouldn't automatically pick the first slot of matching ID type), but for the Action Constraint I (Sybren) feel that it could be a bit more 'enthousiastic' in auto-picking a slot. Note that this is the same behaviour as for NLA strips, albeit for a slightly different reason. Because of that it's not sharing code with the NLA. Pull Request: https://projects.blender.org/blender/blender/pulls/128892