Asset Shelf (for brush assets, pose libraries, etc.) #102879

Open
opened 2022-11-30 16:57:52 +01:00 by Julian Eisel · 6 comments

Developed as part of #101895 (Brush Asset Project).


This is an epic (high level requirement) for the brush asset project, but is meant as a new general UI to provide an efficient usage experience for all kinds of asset (as opposed to a creation and organization experience). It includes the following main deliverables:

  • Asset shelf basics
      • Basic asset shelf settings (enabled asset catalogs, active catalog, filter settings, ...)
      • Make asset shelf settings instance based (so e.g. an asset shelf for materials remembers different settings than one for poses)
      • Support registration asset shelfs through BPY.
      • Introduce ARegionType.poll() to remove the asset shelf when empty - In master: fa0f295b53
  • Asset shelf main region (prototype done, needs to be reworked)
      • List assets (use a view ?)
      • Filter assets by active catalog
      • Drag support
      • Decide on & implement horizontal vs. vertical scrolling
      • Thumbnail size option
  • Asset shelf footer region:
      • Implement catalog selector popup (to enable catalogs)
      • Display enabled catalogs as tabs
      • Only show catalogs in the selector popup that contain assets of the given type
      • Search
      • Display popup (size settings, show names option, etc.)
  • Port pose library to asset shelf
      • Register an asset shelf
      • Custom apply operator for asset shelf
      • Custom drag operator for asset shelf
    • Technical documentation

General implementation TODOs:

  • Remove prototype code
  • Implement bl_asset_traits syntax for BPY

image.png


Custom (BPY defined) asset shelves

While not a priority for the brush assets project, it should be possible for add-ons to display an asset shelf in further contexts, say an asset shelf for materials in object mode. This requires that the editor supports asset shelves, which is only the case for the 3D view for now.

This is how one could be registered through BPY:

class VIEW3D_AST_asset_shelf_pose_library(bpy.types.AssetShelf):
  # Necessary to identify the settings for this asset shelf based on context
  # (e.g. enabled catalogs for pose library in pose mode).
  bl_idname = "view3d.asset_shelf_pose_library"
  # If multiple categories exist, the shelf displays a menu to choose (e.g. between
  # objects and materials). Multiple shelves with the same category get merged into one.
  bl_category = "Pose Library"
  bl_space_type = 'SPACE_VIEW3D'
  # Assets having all the given traits will be visible (here: pose action assets).
  bl_asset_traits = {"Action", "Pose"}

  @classmethod
  def poll(cls, context):
      return context.object.mode == 'POSE'
Developed as part of #101895 (Brush Asset Project). --- This is an epic (high level requirement) for the brush asset project, but is meant as a new general UI to provide an efficient usage experience for all kinds of asset (as opposed to a creation and organization experience). It includes the following main deliverables: - - [x] "All" asset library. - In master: 35e54b52e6ec - Asset shelf basics - - [x] Basic asset shelf settings (enabled asset catalogs, active catalog, filter settings, ...) - - [ ] Make asset shelf settings instance based (so e.g. an asset shelf for materials remembers different settings than one for poses) - - [x] Support registration asset shelfs through BPY. - - [x] Introduce `ARegionType.poll()` to remove the asset shelf when empty - In master: fa0f295b53 - Asset shelf main region (prototype done, needs to be reworked) - - [x] List assets (use a [view ](https://wiki.blender.org/wiki/Source/Interface/Views)?) - - [x] Filter assets by active catalog - - [x] Drag support - - [x] Paginated scrolling + snapped region size - 852becd76c, 6da90998e2, c3b36345c7, 527e4e2be7 - - [ ] Decide on & implement horizontal vs. vertical scrolling - - [ ] Thumbnail size option - Asset shelf footer region: - - [x] Implement catalog selector popup (to enable catalogs) - - [x] Display enabled catalogs as tabs - - [ ] Only show catalogs in the selector popup that contain assets of the given type - - [ ] Search - - [x] Display popup (size settings, show names option, etc.) - Port pose library to asset shelf - - [x] Register an asset shelf - - [x] Custom apply operator for asset shelf - - [x] Custom drag operator for asset shelf - - [ ] Technical documentation General implementation TODOs: - [ ] Remove prototype code - [ ] Implement `bl_asset_traits` syntax for BPY ![image.png](https://archive.blender.org/developer/F13982151/image.png) ---- ## Custom (BPY defined) asset shelves While not a priority for the brush assets project, it should be possible for add-ons to display an asset shelf in further contexts, say an asset shelf for materials in object mode. This requires that the editor supports asset shelves, which is only the case for the 3D view for now. This is how one could be registered through BPY: ```py class VIEW3D_AST_asset_shelf_pose_library(bpy.types.AssetShelf): # Necessary to identify the settings for this asset shelf based on context # (e.g. enabled catalogs for pose library in pose mode). bl_idname = "view3d.asset_shelf_pose_library" # If multiple categories exist, the shelf displays a menu to choose (e.g. between # objects and materials). Multiple shelves with the same category get merged into one. bl_category = "Pose Library" bl_space_type = 'SPACE_VIEW3D' # Assets having all the given traits will be visible (here: pose action assets). bl_asset_traits = {"Action", "Pose"} @classmethod def poll(cls, context): return context.object.mode == 'POSE' ```
Julian Eisel self-assigned this 2022-11-30 16:57:52 +01:00
Poster
Collaborator

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

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

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel

Added subscriber: @Emi_Martinez

Added subscriber: @Emi_Martinez

Added subscriber: @sozap

Added subscriber: @sozap

Added subscriber: @AlexeyAdamitsky

Added subscriber: @AlexeyAdamitsky

Added subscriber: @silex

Added subscriber: @silex
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:39:30 +01:00
Julian Eisel modified the project from Pipeline, Assets & IO to Brush Assets & Asset Shelf 2023-02-20 20:59:57 +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
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
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
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
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
5 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#102879
There is no content yet.