Hierarchical Bone Collections #115934

Closed
opened 2023-12-08 12:15:25 +01:00 by Sybren A. Stüvel · 2 comments

This is a continuation of the work on Bone Collections described in #108941. The work is done in a branch that's tracked by pull request #115945.

Blender 4.0 replaced armature layers with a flat list of bone collections. The next step is to allow nesting of bone collections.

The data structure is as follows:

  • The Armature stores the bone collections as a flat array.
  • This array is converted to a ListBase when writing to the blend file, for forward compatibility with Blender 4.0.
  • Each bone collection has child_index and child_count properties, which index into the flat array of bone collections. Making this index-based is easier to work with than pointer-based, as these indices can be validated, and don't need updating when a copy is made of the Armature.
  • Sibling collections are always consecutive in the array. Root collections are always the first elements of the array.

The work:

  • Instead of a ListBase, bone collections are going to move to an array data structure. This mimicks what the Grease Pencil team is doing for GPv3, and what the Animation & Rigging module is doing for animation layers (#114098). (9e7a70d6c6)
  • Expand BoneCollection with child_index and child_count properties.
  • Expose functions to move bone collections from/to parents (or unparent them).
  • Expose these to RNA, ensuring that the data structure/hierarchy invariants cannot be broken.
  • Document the invariants of the data structure
  • Build a tree UI to manage the bone collections.
  • Redesign the existing operations & UI for (un)assigning bones.
  • General cleanup pass.
  • Test forward compatibility of Blender 4.0.

To keep in mind / nice for later (i.e. after merging with main):

  • GUI: the UIList had a search/filter box, the TreeView does not. This might be nice to add.
  • Hierarchical visibility rules
  • Hierarchical visibility toggling
  • Solo'ing visibility
  • Figuring out how the active index needs to change when manipulating collections.
This is a continuation of the work on Bone Collections described in #108941. The work is done in a branch that's tracked by pull request #115945. Blender 4.0 replaced armature layers with a flat list of bone collections. The next step is to allow nesting of bone collections. The data structure is as follows: - The Armature stores the bone collections as a flat array. - This array is converted to a `ListBase` when writing to the blend file, for forward compatibility with Blender 4.0. - Each bone collection has `child_index` and `child_count` properties, which index into the flat array of bone collections. Making this index-based is easier to work with than pointer-based, as these indices can be validated, and don't need updating when a copy is made of the Armature. - Sibling collections are always consecutive in the array. Root collections are always the first elements of the array. The work: - [x] Instead of a `ListBase`, bone collections are going to move to an array data structure. This mimicks what the Grease Pencil team is doing for GPv3, and what the Animation & Rigging module is doing for animation layers (#114098). (9e7a70d6c6bd14e9984178ec29ac303cb841e651) - [x] Expand `BoneCollection` with `child_index` and `child_count` properties. - [x] Expose functions to move bone collections from/to parents (or unparent them). - [x] Expose these to RNA, ensuring that the data structure/hierarchy invariants cannot be broken. - [x] Document the [invariants of the data structure](https://developer.blender.org/docs/features/animation/armatures/bone_collections/) - [x] Build a tree UI to manage the bone collections. - [x] Redesign the existing operations & UI for (un)assigning bones. - [x] General cleanup pass. - [x] Test forward compatibility of Blender 4.0. To keep in mind / nice for later (i.e. after merging with `main`): - [ ] GUI: the UIList had a search/filter box, the TreeView does not. This might be nice to add. - [x] Hierarchical visibility rules - [x] Hierarchical visibility toggling - [x] Solo'ing visibility - [x] Figuring out how the active index needs to change when manipulating collections.
Sybren A. Stüvel added this to the 4.1 milestone 2023-12-08 12:15:25 +01:00
Sybren A. Stüvel added the
Type
To Do
Module
Animation & Rigging
labels 2023-12-08 12:15:25 +01:00
Nathan Vegdahl was assigned by Sybren A. Stüvel 2023-12-08 12:15:36 +01:00
Sybren A. Stüvel self-assigned this 2023-12-08 12:15:36 +01:00
Sybren A. Stüvel added this to the Animation & Rigging project 2023-12-08 12:15:44 +01:00

Checked out the test build.... great work thus far... thank you, just wondering if this dev work will make this "drag n' drop" functionality available to the add-on community ?

Checked out the test build.... great work thus far... thank you, just wondering if this dev work will make this "drag n' drop" functionality available to the add-on community ?
Author
Member

The work is done, closing this issue.

The work is done, closing this issue.
Blender Bot added the
Status
Archived
label 2024-02-05 12:08:36 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#115934
No description provided.