Display asset node groups in the add menu #95446

Closed
opened 2022-02-02 17:55:39 +01:00 by Hans Goudey · 10 comments
Member

Based on the discussion in #92811, node groups from available asset data-blocks should be displayed in the node editor add menu.

Menu items should be created dynamically based on which catalogs the node groups are part of.
An "Asset" icon should distinguish them from other groups and built-in nodes.

This may require refactoring of the node editor add menu, which is currently generated automatically based on the code in nodeitems_builtins.py (#92825)

Further Questions

  • What do do when a node group is in multiple catalogs? Possibly add two entries in the add menu.
Based on the discussion in #92811, node groups from available asset data-blocks should be displayed in the node editor add menu. Menu items should be created dynamically based on which catalogs the node groups are part of. An "Asset" icon should distinguish them from other groups and built-in nodes. This may require refactoring of the node editor add menu, which is currently generated automatically based on the code in `nodeitems_builtins.py` (#92825) **Further Questions** - What do do when a node group is in multiple catalogs? Possibly add two entries in the add menu.
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Some notes:

  • Asset libraries are currently loaded on activation in the asset browser or asset view templates. This process may take a while (esp if the library isn't indexed yet). So the add menu should support asynchronous loading and indicate the status (loading or done?).
  • The asset system isn't done yet, and the asset browser uses the file browser's per space storage for the list of assets. However, for the asset view templates I've already worked on a global storage system, so this is what you'd use here. The API is simple - I hope :) Should be as simple as calling ED_assetlist_storage_fetch() and adding menu items via ED_assetlist_iterate().
  • For a regular menu users may not expect expensive (async) loading, so maybe it should use a different UI. It could be made more consistent with the normal asset browser/view UIs like suggested in #54642: Assets_Material_Selector.png (A catalog selector should be displayed there too, somehow.)
  • What do do when a node group is in multiple catalogs? Possibly add two entries in the add menu.

An asset can only be in one catalog currently. In future dynamic catalogs may be added which are just filtering presets. These would then allow displaying assets in multiple dynamic catalogs.

Some notes: - Asset libraries are currently loaded on activation in the asset browser or asset view templates. This process may take a while (esp if the library isn't indexed yet). So the add menu should support asynchronous loading and indicate the status (loading or done?). - The asset system isn't done yet, and the asset browser uses the file browser's per space storage for the list of assets. However, for the asset view templates I've already worked on a global storage system, so this is what you'd use here. The API is simple - I hope :) Should be as simple as calling `ED_assetlist_storage_fetch()` and adding menu items via `ED_assetlist_iterate()`. - For a regular menu users may not expect expensive (async) loading, so maybe it should use a different UI. It could be made more consistent with the normal asset browser/view UIs like suggested in #54642: ![Assets_Material_Selector.png](https://archive.blender.org/developer/F2725404/Assets_Material_Selector.png) (A catalog selector should be displayed there too, somehow.) > - What do do when a node group is in multiple catalogs? Possibly add two entries in the add menu. An asset can only be in one catalog currently. In future dynamic catalogs may be added which are just filtering presets. These would then allow displaying assets in multiple dynamic catalogs.

Added subscriber: @ab_stanton

Added subscriber: @ab_stanton

Is there a design task being worked on for this? I thought I'd start implementing it but it seems a bit confused. Will the nodes appear in the add menu as: asset_libary -> catalog -> node group, or will it be as @JulianEisel said with the more asset library-esque UI? I got it working to a basic level in the add menu, but without the add menu refactorings mentioned in #92825 .

Is there a design task being worked on for this? I thought I'd start implementing it but it seems a bit confused. Will the nodes appear in the add menu as: asset_libary -> catalog -> node group, or will it be as @JulianEisel said with the more asset library-esque UI? I got it working to a basic level in the add menu, but without the add menu refactorings mentioned in #92825 .
Author
Member

@ab_stanton Sorry for the delayed response. It's not totally clear honestly. The benefit to adding it in the existing add menu is that node groups could fit right in with builtin nodes, which we've wanted in the past. Julian mentions the benefits to the other approach above. If we use the normal add menu I think we'd have to make sure to support asynchronous loading and showing the status, which sounds like it could be annoying to combine with the UI menu code, not sure.

@ab_stanton Sorry for the delayed response. It's not totally clear honestly. The benefit to adding it in the existing add menu is that node groups could fit right in with builtin nodes, which we've wanted in the past. Julian mentions the benefits to the other approach above. If we use the normal add menu I think we'd have to make sure to support asynchronous loading and showing the status, which sounds like it could be annoying to combine with the UI menu code, not sure.

@HooglyBoogly yeah, also yeah if #92825 does need to be done first then I'm not sure I have the energy for it, refactoring isn't the top of my list of things to do in my spare time. I would be interested to see how the async loading could be incorporated into the menu, can't think of where else in blender implements that, bar maybe the asset library previews, but not any buttons afaik

@HooglyBoogly yeah, also yeah if #92825 does need to be done first then I'm not sure I have the energy for it, refactoring isn't the top of my list of things to do in my spare time. I would be interested to see how the async loading could be incorporated into the menu, can't think of where else in blender implements that, bar maybe the asset library previews, but not any buttons afaik

This issue was referenced by bdb5754147

This issue was referenced by bdb57541475f20ccc4f6e5f8fc075ac424becc19
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Hans Goudey self-assigned this 2023-01-02 16:06:00 +01:00
Sign in to join this conversation.
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
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
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
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#95446
No description provided.