Context: 2021-08-20 Asset Browser and 3.0 meeting.
This is a draft planning for tasks regarding the Catalogs.
UPDATE: This document is superseded by T90066: Design Catalog system
The asset catalog system will be C++ with a C interface where necessary.
Since all the catalog information is runtime-only, there is no need for DNA.
A catalog definition file (CDF) is a plain text (UTF-8) file.
#
are ignored.Any other line should contain a catalog definition:
The CATALOG_ID
may not contain spaces, as a space is used as separator between it and the path. The path can contain spaces.
A library could have zero, one, or multiple catalog definition files.
Multiple definitions of a CATALOG_ID
in one file should be avoided. A warning could be logged (on the terminal, for example) and the first occurrence of the catalog wins.
Defining the same catalog in multiple files is fine, as long as they don't confict. In case of conflict, the one defined in the top-most file wins, and the rest is synchronized when it changes (i.e. when a write is triggered).
Multiple locations are supported:
${ASSET_LIBRARY_ROOT}/blender-asset-library.cats.txt
blendfile-path-without-extension.cats.txt
blender-asset-library.cats.txt
in each subdirectory? Will become relevant when subdirs are possible with the Asset Browser.What happens when writing the file? Probably best to keep the line ending that's in use (to stay friendly with versioning systems).
A catalog can be defined in multiple files, and when updated should be written to all those files.
This can be done by keeping track of a set<AssetCatalogDefinitionFile *>
in each catalog.
The catalog paths are what users will be primarily interacting with. The catalog IDs allow for nifty tricks (like moving assets without updating their blend file), but do make things harder to explain/use. This should be clear in the UI.
Users have to choose a catalog ID, which could default to the slugified last element of the catalog path.
Something (user or Blender) has to choose where to save the catalog info:
AssetMetaData
A symbolic identifier of which catalog path this asset is stored in.
TBD: the max length. 64 was just chosen arbitrarily.
AssetLibraryCatalogs
classManages catalogs of a single asset library.
TBD: this needs to be split up into smaller TODOs.
TBD: internal data structure. What is written above is just one simple idea. It's probably better to have the internal structure stored in a tree, such that a rename of a path just requires moving some elements of the tree around. Might be over-engineered though, as the catalogs are meant to be human-manageable and thus there won't be thousands of them anyway.
Make things collapsible, selectable, determines which assets are shown in the asset browser.
Allows renaming and moving of catalogs. These operations are the same from the CDF perspective, but are different operations for the user interface.
The asset browser should be able to show assets from a single catalog path + its children.