Anim: add Action + Slot selectors in property panels #125666

Merged
Sybren A. Stüvel merged 3 commits from dr.sybren/blender:anim/action-selector-properties-editor into main 2024-09-02 12:10:31 +02:00

This PR adds Action + Slot selectors to the Properties editor.

Currently this is done only in two places, which represent two different scenarios. Once these have been approved, the approach can be copied to other datablock types.

  • Camera properties. This is a simple object data ID, where all shown properties are owned by the same ID.
  • Material properties. This is a more complex case, where the material itself is an ID, but also embeds its own node tree (NT). That NT is an ID by itself, but doesn't appear in bmain. However, because it's an ID, it has an Action of its own. Because of this, there are two Action selectors in the Material properties.
Camera Material
image image

Example blend file: 125666-slot-selectors-property-panel.blend


The above images show the base UI as implemented in this PR. In a future PR we want to simplify the situations where one "conceptual thing" (like a Material) is actually two IDs (that thus have two Actions + Slots). We have some ideas to limit the UI to only a single Action selector + two Slot selectors, but such changes are left for the future. For now we just want to expose how Blender currently works.


This PR consists of various commits, and I think it's a good idea to keep those separated. For reviewing it's probably better to have them together though, as one is needed to fix an issue that's only shown when you have the other. And then there are some followup commits for mergin new origin/main in, etc. I'll clean that up before landing.

This PR adds Action + Slot selectors to the Properties editor. Currently this is done only in two places, which represent two different scenarios. Once these have been approved, the approach can be copied to other datablock types. - **Camera** properties. This is a simple object data ID, where all shown properties are owned by the same ID. - **Material** properties. This is a more complex case, where the material itself is an ID, but also embeds its own node tree (NT). That NT is an ID by itself, but doesn't appear in `bmain`. However, because it's an ID, it has an Action of its own. Because of this, there are two Action selectors in the Material properties. | Camera | Material | |--|--| | <img width="399" alt="image" src="/attachments/c1bc1016-dac2-40b6-bc0f-0bca82348e5e"> | <img width="399" alt="image" src="/attachments/ccac05f4-6f30-481c-885a-b9519bb2e4ac"> | Example blend file: [125666-slot-selectors-property-panel.blend](https://projects.blender.org/attachments/03600335-5abf-47e8-ae0a-abbaf1c3aaf4) ---------- The above images show the base UI as implemented in this PR. In a future PR we want to simplify the situations where one "conceptual thing" (like a Material) is actually two IDs (that thus have two Actions + Slots). We have some ideas to limit the UI to only a single Action selector + two Slot selectors, but such changes are left for the future. For now we just want to expose how Blender currently works. ---------- This PR consists of various commits, and I think it's a good idea to keep those separated. For reviewing it's probably better to have them together though, as one is needed to fix an issue that's only shown when you have the other. And then there are some followup commits for mergin new `origin/main` in, etc. I'll clean that up before landing.
Sybren A. Stüvel added the
Interest
User Interface
Module
Animation & Rigging
labels 2024-07-30 15:49:34 +02:00
Sybren A. Stüvel added 4 commits 2024-07-30 15:49:43 +02:00
Add a UI template `UILayout.template_action()`. It allows selecting the
Action that is assigned to a data-block.

Normally `template_ID()` would be used for such things, but that is not
usable for assigning Actions. The issue is that that template requires
an RNA property to exist to operate on. Such a call (from Python) would
look like `layout.template_ID(id.animation_data, "action", ...)`, but
when the ID has never been animated, `id.animation_data` is `None`,
which has no "action" property.

The `template_action()` template is coded to deal with these cases.
Anim: Replace Action selector in Action editor with template_action()
All checks were successful
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
9f8f5163e7
Replace the Action selector in the Action editor with the new
`template_action()` UI template. This also required updating the
`action.new` and `action.unlink` operators to reliably work with the
context set by the UI template.
Author
Member

@blender-bot build

@blender-bot build
Nathan Vegdahl approved these changes 2024-07-30 18:34:03 +02:00
Nathan Vegdahl left a comment
Member

Code looks good to me, and it works as expected.

Code looks good to me, and it works as expected.
Author
Member

@blender-bot build

@blender-bot build
Author
Member

@JulianEisel and I just discussed the UI Module's view on this PR. In short, it's good to go in, given that it's still an experimental feature. Both the UI and Animation & Rigging modules have ideas for improvements. Those are easier to explore once this PR has landed.

@JulianEisel and I just discussed the UI Module's view on this PR. In short, it's good to go in, given that it's still an experimental feature. Both the UI and Animation & Rigging modules have ideas for improvements. Those are easier to explore once this PR has landed.
Sybren A. Stüvel force-pushed anim/action-selector-properties-editor from 4c1fb7fce8 to aa118056d2 2024-08-30 16:01:53 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Sybren A. Stüvel force-pushed anim/action-selector-properties-editor from aa118056d2 to ff4c62cd51 2024-09-02 11:23:07 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Sybren A. Stüvel merged commit f917b60036 into main 2024-09-02 12:10:31 +02:00
Sybren A. Stüvel deleted branch anim/action-selector-properties-editor 2024-09-02 12:10:35 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 project
No Assignees
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#125666
No description provided.