Animation: create a full separate copy of BoneCollections while in armature edit mode #112134

Open
opened 2023-09-08 13:05:34 +02:00 by Nathan Vegdahl · 5 comments
Member

This is to avoid touching the main data structures in the Armature datablock while in edit mode, which interacts badly with undo.

Relevant:

This is to avoid touching the main data structures in the Armature datablock while in edit mode, which interacts badly with undo. Relevant: - #111965
Nathan Vegdahl added the
Type
To Do
Module
Animation & Rigging
labels 2023-09-08 13:05:45 +02:00
Nathan Vegdahl added this to the Animation & Rigging project 2023-09-08 13:05:50 +02:00
Nathan Vegdahl added this to the 4.1 milestone 2023-09-08 13:05:55 +02:00

How would this work with the Python API? The Armature.collections property would probably have to magically choose which list to use.

How would this work with the Python API? The Armature.collections property would probably have to magically choose which list to use.
Author
Member

That's a good question. And it does give me a bit of pause if this is actually what we want to proceed with, rather than e.g. waiting to just get rid of the edit mode data structures entirely. @mont29 and @dr.sybren, thoughts?

The Armature.collections property would probably have to magically choose which list to use.

That's one way it could work. Another way would be to mirror the Bone/EditBone distinction, by having a separate BoneCollection API for edit mode. That would be clunky, but it would be consistent with the whole Bone/EditBone thing, which is similarly clunky.

That's a good question. And it does give me a bit of pause if this is actually what we want to proceed with, rather than e.g. waiting to just get rid of the edit mode data structures entirely. @mont29 and @dr.sybren, thoughts? > The Armature.collections property would probably have to magically choose which list to use. That's one way it could work. Another way would be to mirror the Bone/EditBone distinction, by having a separate BoneCollection API for edit mode. That would be clunky, but it would be consistent with the whole Bone/EditBone thing, which is similarly clunky.

I would try mirroring the bone/editbone behavior yes (this is short-term solution anyways). We can think further if that fails.

I would try mirroring the bone/editbone behavior yes (this is short-term solution anyways). We can think further if that fails.

I'd prefer a more magic armature.collections property. That seems easier for scripters (they can just use the same property in any mode) and also it's a bit more future-proof (it keeps working if/when we remove the whole editbone mess).

There's plenty of code that does if (arm->edbo != nullptr) { ... special case ... }, and I think that's fine too in the RNA accessors for the collections property & the functions on that type.

IMO it's important that we create a future-proof API. That way we can alter things "on the inside" without having to worry about breaking changes.

I'd prefer a more magic `armature.collections` property. That seems easier for scripters (they can just use the same property in any mode) and also it's a bit more future-proof (it keeps working if/when we remove the whole editbone mess). There's plenty of code that does `if (arm->edbo != nullptr) { ... special case ... }`, and I think that's fine too in the RNA accessors for the `collections` property & the functions on that type. IMO it's important that we create a future-proof API. That way we can alter things "on the inside" without having to worry about breaking changes.

Yikes I read Nathan's comment too fast (and forgot how EditBones are currently handled in RNA!).

Indeed what I wanted to say is that I would rather have a single API for bone collections regardless of the mode, and have the RNA do the 'smart choosing' behind the scene. So I agree with Sybren and Alexander here.

Yikes I read Nathan's comment too fast (and forgot how EditBones are currently handled in RNA!). Indeed what I wanted to say is that I would rather have a single API for bone collections regardless of the mode, and have the RNA do the 'smart choosing' behind the scene. So I agree with Sybren and Alexander here.
Sybren A. Stüvel removed this from the 4.1 milestone 2024-03-13 09:25:35 +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
No Assignees
4 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#112134
No description provided.