76bddb41df7feca8e055d3bbcc58dc574d07147f
When creating a new NLA strip for an action, as well as when setting `strip.action` via RNA, use the generic action-assignment code. This ensures that the slot selection follows the same logic as other Action assignments. If the generic slot selection doesn't find a suitable slot, and there is a single slot on that Action of a suitable ID type, always assign it. This is to support the following scenario: - Python script creates an Action and adds F-Curves via the legacy API. - This creates a slot 'XXSlot'. - The script creates multiple NLA strips for that Action. - The desired result is that these strips get the same Slot assigned as well. The generic code doesn't work for this, because: - The first strip assignment would see the slot `XXSlot` (`XX` indicating "not bound to any ID type yet"). Because that slot has never been used, it will be assigned (which is good). This assignment would change its name to, for example, `OBSlot`. - The second strip assignment would not see a 'virgin' slot, and thus not auto-select `OBSlot`. This behaviour makes sense when assigning Actions in the Action editor (assigning an Action that already animates 'Cube' to 'Suzanne' should not assign the 'OBCube' slot to Suzanne), but for the NLA I feel that it could be a bit more 'enthousiastic' in auto-picking a slot to support the above case. This is preparation for the removal of the 'Slotted Actions' experimental flag, and getting the new code to run as compatibly as possible with the legacy code. The return value of `animrig::nla::assign_action()` has changed a bit. It used to indicate whether a slot was auto-selected; it now indicates whether the Action assignment was successful. Whether a slot was assigned or not can be seen at `strip.action_slot`. Pull Request: https://projects.blender.org/blender/blender/pulls/128892
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
