Brush asset shelf popup #119217

Merged
Julian Eisel merged 33 commits from JulianEisel/blender:brush-asset-asset-shelf-popup into brush-assets-project 2024-04-26 16:03:10 +02:00
Member

Things should be working, design definitely needs evaluation as part of the brush assets project.

Things should be working, design definitely needs evaluation as part of the brush assets project. <video controls src="https://projects.blender.org/attachments/1e555095-7291-4775-9018-dcd932e01d56"> </video>
Julian Eisel added 1 commit 2024-03-08 18:24:54 +01:00
3c7bc28f13 Initial asset shelf popup prototype
Plenty of work still, this crashes easily. Also needs some design
work. But it's something halfway working to evaluate, and it's quite fun
:)
Julian Eisel added 1 commit 2024-03-13 18:01:32 +01:00
Julian Eisel added 1 commit 2024-03-14 16:48:07 +01:00
15673169d2 Fix various crashes with the catalog tree, allow refreshing
The popup would close and free data before the catalog tree handling
ran. Generally interactions with the catalog tree shouldn't close the
popup, and supporting refreshing of the popup (so that the layout can
change and the popup size too) is important to support. So now the popup
stays open until a new brush is selected, which I think is the desired
behavior.
Julian Eisel added 1 commit 2024-03-14 18:18:11 +01:00
Julian Eisel added 1 commit 2024-03-14 18:19:45 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
85a0a11c24
Use own catalog tree view to allow activating catalog
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR119217) when ready.
Julian Eisel added 1 commit 2024-03-20 20:29:05 +01:00
Julian Eisel added 1 commit 2024-03-21 11:37:15 +01:00
Julian Eisel added 1 commit 2024-03-21 11:55:45 +01:00
Julian Eisel added 1 commit 2024-03-21 17:54:49 +01:00
Julian Eisel added 1 commit 2024-03-22 20:36:53 +01:00
Julian Eisel added 1 commit 2024-03-27 17:21:39 +01:00
Julian Eisel added 1 commit 2024-03-27 20:06:29 +01:00
Julian Eisel added 1 commit 2024-03-27 20:09:37 +01:00
Julian Eisel added 1 commit 2024-03-27 20:12:27 +01:00
Julian Eisel added 1 commit 2024-03-27 20:21:37 +01:00
Julian Eisel added 2 commits 2024-03-28 16:54:42 +01:00
Julian Eisel added 1 commit 2024-03-28 17:00:49 +01:00
Brecht Van Lommel reviewed 2024-03-28 17:32:26 +01:00
@ -0,0 +30,4 @@
const ScrArea *area,
AssetShelfType &shelf_type)
{
ARegion *shelf_region = BKE_area_find_region_type(area, RGN_TYPE_ASSET_SHELF);

I guess this means the asset shelf popup can only be opened from a 3D viewport and in the future the image editor. It will not work in the properties editor?

It's also strange to me that state would be tied to a specific 3D viewport. Multiple could be open, and I would expect the popup to be independent of which one you opened it from.

I guess this means the asset shelf popup can only be opened from a 3D viewport and in the future the image editor. It will not work in the properties editor? It's also strange to me that state would be tied to a specific 3D viewport. Multiple could be open, and I would expect the popup to be independent of which one you opened it from.
brecht marked this conversation as resolved
Author
Member

Replying to the inline comment here, since this is higher level discussion:

I guess this means the asset shelf popup can only be opened from a 3D viewport and in the future the image editor. It will not work in the properties editor?

Yes, that's mostly due to the decision we made in the asset shelf review to store asset shelf data as asset-shelf region-data, so you need to have an asset shelf region available.

However I'm not convinced that we'd want to support displaying asset shelves in the properties editor, or other such UIs. Asset shelves have quite some shenanigans for context sensitivity, asset shelf data storage, asset shelf settings, region behavior, file read/write, ... A popup to choose an asset (for example for the ID template) should be much simpler. Just displaying the assets (and the catalogs) in a popup is easy. Also options like the preview size and "Show Names" are mostly just there to optimize the asset shelf for keeping it visible on screen, I don't think we need these options for a popup asset selector.

Now thinking about it, I'm wondering if what we want for brushes is actually the asset shelf as popup or the simpler popup I just described. We just always talked about the "asset shelf as a popup" so that's how I implemented it. But given that we need to do advanced filtering (show brush types based on context/active mode), and call a custom operator on click, I think using the asset shelf makes sense, especially since that needs to exists anyway.

It's also strange to me that state would be tied to a specific 3D viewport. Multiple could be open, and I would expect the popup to be independent of which one you opened it from.

I don't think that's a big deal. But we could store the popup asset shelf data in the workspace instead and stick to the region-data for the permanent region. Not sure yet how much work this would be.

Replying to the inline comment here, since this is higher level discussion: > I guess this means the asset shelf popup can only be opened from a 3D viewport and in the future the image editor. It will not work in the properties editor? Yes, that's mostly due to the decision we made in the asset shelf review to store asset shelf data as asset-shelf region-data, so you need to have an asset shelf region available. However I'm not convinced that we'd want to support displaying asset shelves in the properties editor, or other such UIs. Asset shelves have quite some shenanigans for context sensitivity, asset shelf data storage, asset shelf settings, region behavior, file read/write, ... A popup to choose an asset (for example for the ID template) should be much simpler. Just displaying the assets (and the catalogs) in a popup is easy. Also options like the preview size and "Show Names" are mostly just there to optimize the asset shelf for keeping it visible on screen, I don't think we need these options for a popup asset selector. Now thinking about it, I'm wondering if what we want for brushes is actually the asset shelf as popup or the simpler popup I just described. We just always talked about the "asset shelf as a popup" so that's how I implemented it. But given that we need to do advanced filtering (show brush types based on context/active mode), and call a custom operator on click, I think using the asset shelf makes sense, especially since that needs to exists anyway. > It's also strange to me that state would be tied to a specific 3D viewport. Multiple could be open, and I would expect the popup to be independent of which one you opened it from. I don't think that's a big deal. But we _could_ store the popup asset shelf data in the workspace instead and stick to the region-data for the permanent region. Not sure yet how much work this would be.
Julian Eisel added 1 commit 2024-04-04 11:50:14 +02:00
Julian Eisel added 1 commit 2024-04-10 17:03:20 +02:00
Julian Eisel added 1 commit 2024-04-24 17:27:09 +02:00
Julian Eisel added 1 commit 2024-04-24 18:19:12 +02:00
Julian Eisel added 1 commit 2024-04-25 17:04:55 +02:00
Julian Eisel added 1 commit 2024-04-25 18:28:23 +02:00
e464d51aae Make popup asset shelf storage static
There's now a static list of asset-shelves, one shelf for each asset
shelf type that was previously opened in a popup.
Author
Member

The asset shelf data/settings is now stored statically, independent of the asset shelf region. Earlier we discussed storing it in the workspace or the preferences instead, both are still possible, but I think static storage is fine as well even. Can still be done easily now, but good to see as first step that region independent storage is possible, and not ugly to deal with in code even.

The asset shelf data/settings is now stored statically, independent of the asset shelf region. Earlier we discussed storing it in the workspace or the preferences instead, both are still possible, but I think static storage is fine as well even. Can still be done easily now, but good to see as first step that region independent storage is possible, and not ugly to deal with in code even.
Brecht Van Lommel approved these changes 2024-04-25 18:50:10 +02:00
Julian Eisel added 1 commit 2024-04-26 12:41:57 +02:00
Julian Eisel added 1 commit 2024-04-26 12:54:10 +02:00
Julian Eisel added 1 commit 2024-04-26 12:56:32 +02:00
Julian Eisel added 1 commit 2024-04-26 12:59:16 +02:00
Julian Eisel changed title from WIP: Brush asset shelf popup to Brush asset shelf popup 2024-04-26 13:01:07 +02:00
Hans Goudey reviewed 2024-04-26 14:03:45 +02:00
Hans Goudey left a comment
Member

Just a few small comments, overall looks fine.

Just a few small comments, overall looks fine.
@ -61,0 +68,4 @@
/* -------------------------------------------------------------------- */
/** \name Asset shelf type */
bool asset_shelf_type_poll(const bContext &C,
Member

I think the asset_shelf_ prefix on these functions is redundant with the namespace, they'll usually be called like asset::shelf::type_poll

I think the `asset_shelf_` prefix on these functions is redundant with the namespace, they'll usually be called like `asset::shelf::type_poll`
JulianEisel marked this conversation as resolved
@ -61,0 +72,4 @@
const SpaceType &space_type,
const AssetShelfType *shelf_type);
AssetShelfType *asset_shelf_type_find_from_idname(const SpaceType &space_type,
blender::StringRefNull idname);
Member

blender:: is unnecessary

`blender::` is unnecessary
JulianEisel marked this conversation as resolved
@ -75,0 +75,4 @@
StringRefNull idname)
{
for (const std::unique_ptr<AssetShelfType> &shelf_type : space_type.asset_shelf_types) {
if (STREQ(idname.c_str(), shelf_type->idname)) {
Member

idname == shelf_type->idname

`idname == shelf_type->idname`
JulianEisel marked this conversation as resolved
@ -0,0 +26,4 @@
namespace blender::ed::asset::shelf {
class PopupAssetShelfStorage {
Member

Similarly, PopupStorage is less redundant given the context

Similarly, `PopupStorage` is less redundant given the context
Author
Member

PopupStorage sounds more like we're storing popups here. Went with StaticPopupShelves, I think that's nicely descriptive.

`PopupStorage` sounds more like we're storing popups here. Went with `StaticPopupShelves`, I think that's nicely descriptive.
@ -0,0 +28,4 @@
class PopupAssetShelfStorage {
public:
ListBase popup_shelves;
Member

LiseBase -> Vector<AssetShelf *>

`LiseBase` -> `Vector<AssetShelf *>`
JulianEisel marked this conversation as resolved
Julian Eisel added 1 commit 2024-04-26 15:09:45 +02:00
Julian Eisel added 1 commit 2024-04-26 15:31:02 +02:00
Julian Eisel added 3 commits 2024-04-26 15:52:53 +02:00
Hans Goudey approved these changes 2024-04-26 15:59:52 +02:00
Julian Eisel changed title from Brush asset shelf popup to WIP: Brush asset shelf popup 2024-04-26 16:02:12 +02:00
Julian Eisel changed title from WIP: Brush asset shelf popup to Brush asset shelf popup 2024-04-26 16:02:39 +02:00
Julian Eisel merged commit 1f83f277dc into brush-assets-project 2024-04-26 16:03:10 +02:00
Julian Eisel deleted branch brush-asset-asset-shelf-popup 2024-04-26 16:03:13 +02: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 project
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#119217
No description provided.