Brush Assets Design #116338

Open
opened 2023-12-19 13:01:40 +01:00 by Brecht Van Lommel · 2 comments

Rough draft of the latest iteration of the brush assets design.

To be updated as we go during development, and then moved to the developer docs.

Storage

No separate drafts storage, everything goes to the default user library. Asset libraries in the preferences get a boolean indicating which is the default library to save to.

Duplicated brush assets are saved in <Asset Library>/Saved/Brushes/brush_name.asset.blend. When saving the asset, only a single datablock and its dependencies are saved, no workspaces or scenes. These types of .asset.blend files are the ones where assets can be updated and deleted.

Additional datablocks used by the asset, like textures and images, are also pushed to this file. Images will be packed, to make the asset file self contained.

Editing Considerations

Updating and deleting assets is not undoable. Therefore at least deleting should show a confirmation popup. Updating could get a popup when updating by dragging an asset on top of an existing one in the asset browser, as there is some risk of doing this accidentally.

Update and delete operations for regular blend files would be disabled, and show a tooltip or dialog like the following:

This is a read-only asset from characters/bob/bob.blend.
It can be edited by opening the file.

Arguably, if a blend file was placed in the user library (not project library), its only purpose is to contain appendable assets and it should be editable, so this could be considered for a following iteration.

If we support pushing assets to arbitrary blend files, we should clearly communicate the consequences and ask for confirmation. For example a dialog like:

Update Asset?
This will modify the asset in characters/bob/bob.blend.
The entire file will be upgraded from Blender 3.6 to 4.2.

Delete asset would remove the asset metadata from the datablock, instead of deleting it.

Regardless of restrictions on pushing, we should communicate when a blend file that was opened in Blender is part of an asset library. The window title should show the asset library name, or alternatively the project name when support for that is added.

Multiple Libraries

Essential and extensions add-ons would always be read-only. But other asset libraries in the preferences would support asset pushing.

To choose the asset library, there two ways of doing it:

  • A single asset library is marked as default, to indicate the library to save brushes and other assets to.
  • The duplicate asset operator offers an option to choose which library to save to with a small sub menu, or popup menu for drag & drop.

We can get user feedback to figure out which is most convenient.

Hide & Replace

Users may want to hide or replace brushes from the essentials asset library, or potentially other asset libraries. This may be because they want to use a different set of brushes than the default essentials, or because they want to change the default of one or two settings.

The plan is to accomplish this as follows.

  • Assets metadata gets asset weak reference indicating another asset it replaces.
  • When this is present, the original asset gets hidden automatically.
  • Hiding an essentials assets would be accomplished by this replacement, along with assigning it to a special Trash catalog.
  • The Trash catalog will also be used to make deleting assets undoable in general.

Indexing

Asset library indexes do not store previews, this would need to be changed for effiency.

In fact we should considering making a search index for the entire libraries, because the current system is more like a metadata file per .blend, and not optimized for dealing with many .blend files and datablocks. This will become more important for project asset libraries.

An sqlite database per asset library would be a better solution, for efficient queries and incremental updates. This would be a true search index that can be safely deleted and regenerated. Not a file that may be the source of truth for some data, as is the case for current asset index files.

A first iteration of brush assets does not strictly have to have this optimization, particularly if we make an exception for brushes and save them in a single .blend file.

Other Datablocks

While this is focusing specifically on the brush use case, the intent is to extend this same system to node groups, materials, etc.

Rough draft of the latest iteration of the brush assets design. To be updated as we go during development, and then moved to the developer docs. ## Storage No separate drafts storage, everything goes to the default user library. Asset libraries in the preferences get a boolean indicating which is the default library to save to. Duplicated brush assets are saved in `<Asset Library>/Saved/Brushes/brush_name.asset.blend`. When saving the asset, only a single datablock and its dependencies are saved, no workspaces or scenes. These types of `.asset.blend` files are the ones where assets can be updated and deleted. Additional datablocks used by the asset, like textures and images, are also pushed to this file. Images will be packed, to make the asset file self contained. ## Editing Considerations Updating and deleting assets is not undoable. Therefore at least deleting should show a confirmation popup. Updating could get a popup when updating by dragging an asset on top of an existing one in the asset browser, as there is some risk of doing this accidentally. Update and delete operations for regular blend files would be disabled, and show a tooltip or dialog like the following: > This is a read-only asset from characters/bob/bob.blend. > It can be edited by opening the file. Arguably, if a blend file was placed in the user library (not project library), its only purpose is to contain appendable assets and it should be editable, so this could be considered for a following iteration. If we support pushing assets to arbitrary blend files, we should clearly communicate the consequences and ask for confirmation. For example a dialog like: > Update Asset? > This will modify the asset in characters/bob/bob.blend. > The entire file will be upgraded from Blender 3.6 to 4.2. Delete asset would remove the asset metadata from the datablock, instead of deleting it. Regardless of restrictions on pushing, we should communicate when a blend file that was opened in Blender is part of an asset library. The window title should show the asset library name, or alternatively the project name when support for that is added. ## Multiple Libraries Essential and extensions add-ons would always be read-only. But other asset libraries in the preferences would support asset pushing. To choose the asset library, there two ways of doing it: * A single asset library is marked as default, to indicate the library to save brushes and other assets to. * The duplicate asset operator offers an option to choose which library to save to with a small sub menu, or popup menu for drag & drop. We can get user feedback to figure out which is most convenient. ## Hide & Replace Users may want to hide or replace brushes from the essentials asset library, or potentially other asset libraries. This may be because they want to use a different set of brushes than the default essentials, or because they want to change the default of one or two settings. The plan is to accomplish this as follows. * Assets metadata gets asset weak reference indicating another asset it replaces. * When this is present, the original asset gets hidden automatically. * Hiding an essentials assets would be accomplished by this replacement, along with assigning it to a special Trash catalog. * The Trash catalog will also be used to make deleting assets undoable in general. ## Indexing Asset library indexes do not store previews, this would need to be changed for effiency. In fact we should considering making a search index for the entire libraries, because the current system is more like a metadata file per .blend, and not optimized for dealing with many .blend files and datablocks. This will become more important for project asset libraries. An sqlite database per asset library would be a better solution, for efficient queries and incremental updates. This would be a true search index that can be safely deleted and regenerated. Not a file that may be the source of truth for some data, as is the case for current asset index files. A first iteration of brush assets does not strictly have to have this optimization, particularly if we make an exception for brushes and save them in a single `.blend` file. ## Other Datablocks While this is focusing specifically on the brush use case, the intent is to extend this same system to node groups, materials, etc.
Brecht Van Lommel added the
Type
Design
label 2023-12-19 13:01:40 +01:00
Brecht Van Lommel added this to the Brush Assets & Asset Shelf project 2023-12-19 13:01:42 +01:00
Brecht Van Lommel changed title from Brush Asset Design to Brush Assets Design 2023-12-19 13:01:48 +01:00
Contributor

I want to take Asset Libraties panel from File Paths to its own category in preferences and did so in my local build. I think its a good time to do that. Theyre too important to be hidden like that and new category in preferences called "Asset Libraries" can be a place where we put new properties for brush assets.

Can I post that PR? Would you be interested? @brecht

I want to take Asset Libraties panel from File Paths to its own category in preferences and did so in my local build. I think its a good time to do that. Theyre too important to be hidden like that and new category in preferences called "Asset Libraries" can be a place where we put new properties for brush assets. Can I post that PR? Would you be interested? @brecht
Author
Owner

It seems good, but we'll likely only commit such a PR for Blender 4.2. There will also be preferences changes related to the extensions project, and I prefer to see how all the pieces fit together rather than having an intermediate state for one release.

It seems good, but we'll likely only commit such a PR for Blender 4.2. There will also be preferences changes related to the extensions project, and I prefer to see how all the pieces fit together rather than having an intermediate state for one release.
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
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#116338
No description provided.