Asset System: Data Storage, Reading & UI Access #88184
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#88184
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Asset System: Data Storage, Reading & UI Access
Internal architecture for storing and accessing assets (actually asset-handles, i.e. an efficient representation of the asset), as well as preparing them for display in the UI.
Current Design
The current Asset Browser design is based on the File Browser. This already has a system for data storage, reading and UI access:
FileList
About
FileList
Each File Browser editor stores a
FileList
. It does a fair bit of heavy lifting. Its main responsibilities are:Main
).There is also a fair amount of code for the old asset engine design.
All of these features are good to have in general, we should not remove them.
Its Problems
FileList
does too many things; there is no separation of concerns.Code is very hard to follow and reason about.
The asset system requires a storage that is independent of the File Browser.
FileList
does UI specific things that are already done elsewhere in the UI.Proposal
We do not need to start entirely from scratch. We should be able to pick apart
FileList
and re-build it into a new design. Here is how that could look.Separation of Concerns
The different responsibilities from above can be split into a few basic concerns:
These are the main concernes that should be separated clearly, with well defined interfaces in-between.
Reading
AbstractFileReader
? TBD.(A bit awkward to call assets "files", besides that it makes sense. Better naming idea welcome.)
TODO. Basically: Recursive, concurrent loading of files from disk (including .blend libraries). Different kinds of files, so OOP style inheritance makes sense.
In future we might want a file-reading implementation for asset caches too. These would be simple .json files with meta-data stored inside an asset library.
Could be exposed to Python somehow, so Add-ons can implement custom asset reading, e.g. via the web.
Storing
Base class
AbstractFileList
.The asset specific implementation would look like this:
// etc.
There could be a separate asset list for each library. That way we can cache that data as we like. Note that we can also lazy-load parts of an asset library into the list.
We'll need some way to identify an asset library (also needed in DNA, so uses C here):
Sybren had the interesting idea of using URIs for this.
There would be a global storage for assets:
/* Global map as storage of asset-lists, per library. */
static AssetListMap global_storage_;
This essentially is a "model" in the model-view-controller pattern.
Viewing
If the storage part represents the model, this part represents the view. Idea is a general abstraction:
uiModelView
. It gives a view into a (potentially big) data-set, i.e. a model. This could be useful for the rest of Blender too, but we can keep it very simple for the start.For assets, there would be the following model-view:
UIs like the
UIList
or the File Browser can get their view onto data via theuiModelView
interface. Once the data is fetched into such a view, they do not need to know about the exact implementation (e.g. if this is an asset list, a file list, an RNA collection, ...).Putting it all Together
Who is responsible for putting this all together?
Few things:
AssetLibraryReference
(could be a URI).AssetListStorage
to fetch the needed assets. For example the asset-view UI template does this before creating the list.AssetList
orAssetListStorage
creates the appropriate reader and invokes it via theAbstractFileReader
interface. The reading can be threaded for non-local data.AssetView
from the readAssetList
. This way it gets a view into the data that it can work with for drawing, interaction, filtering, etc.The File Browser
The File Browser should be ported to using this new design as well. I.e.
FileList
should be entirely replaced by the new design.Workload
All of this sounds like a lot of work. Things can be kept very simple for the start though. We don't need rich APIs yet. This is just about thinking carefully about the general direction, which will have long-term impact. Once we know which direction to go, we can add just the bits necessary for what we need for the current project goals.
Added subscriber: @JulianEisel
Quick update on how the asset system could work together with the file system/list:
Added subscriber: @Michael-Drake
Added subscriber: @AlexeyAdamitsky
I am removing the
Needs Triage
label. This is under the general rule that Design and TODO tasks should not have a status.If you believe this task is no longer relevant, feel free to close it.
I don't really want to go this direction anymore, it was from early design exploration, so closing this.