Make it possible to nest bone collections. The data structure on the
armature is still a flat array. It is organised as follows:
- Sibling collections (i.e. ones with the same parent) are stored
sequentially in the array.
- Each bone collection keep track of the number of children, and the
index of the first child.
- Root collections (i.e. ones without parent) are stored as the first
elements in the array.
- The number of root collections is stored on the Armature.
This commit also contains the following:
- Replaced the flat UIList of bone collections with a tree view.
- Updated the M/Shift+M operators (move/assign to collection) to work
with hierarchical bone collections.
- Updated RNA interface to expose only root collections at
`armature.collections`. All collections are available on
`armature.collections.all`, and children at `bonecollection.children`.
- Library override support. Only new roots + their subtrees can be added
via overrides.
See #115934
Co-authored with @nathanvegdahl and @nrupsis.
Instead of `Collections`, describe a section as `Collection Properties`.
Otherwise it's ambiguous whether it's about that or specifically bone
collections.
No functional changes.
Remove the `OPTYPE_REGISTER` flag, to ensure the operators do not pop up
their redo panel. The flag is removed where the operator properties are
set by Python code, instead of chosen by the user. For example, it doesn't
make much sense to change which bone collection is used by the operator by
typing the name of another bone collection.
This could be revisited when Blender supports "nested enum" properties,
to make it possible to choose an item in an entire hierarchy.
Rename `bonecoll_find_index` to `armature_bonecoll_find_index` (because
it takes a `bArmature*` parameter), and move it from a static function into
the `blender::animrig` namespace. It will be used externally in upcoming
commits.
No functional changes.
Move some of the functionality of `ANIM_armature_runtime_refresh()` into
a function of its own (`ANIM_armature_bonecoll_active_runtime_refresh()`).
It will be called from another place as well in upcoming commits.
No functional changes.