Page MenuHome

Asset Browser: Support custom asset library paths through Preferences
ClosedPublic

Authored by Julian Eisel (Severin) on Dec 2 2020, 8:56 PM.

Details

Summary

One of the core design aspects of the Asset Browser is that users can "mount" custom asset libraries (.blends or directories) via the Preferences.

Idea is simple: In PreferencesFile Paths, you can create custom libraries, by setting a name and selecting a path. The name is ensured to be unique.
The repository path is not checked for validity, the Asset Browser will allow selecting invalid libraries, but show a message instead of the file list, to help the user understand what's going on.
Currently, only .blend files are supported as libraries. But directories should eventually be supported as well, see T82682: Support Directories as Asset Repositories.

Diff Detail

Repository
rB Blender
Branch
temp-review-asset-repositories (branched from master)
Build Status
Buildable 11653
Build 11653: arc lint + arc unit

Event Timeline

Julian Eisel (Severin) requested review of this revision.Dec 2 2020, 8:56 PM
Julian Eisel (Severin) created this revision.

I don't think $HOME/assets.blend is actually a location we want to recommend. And if we version patch that into the user preferences, we can't remove it since we don't know if a user now actually relies on this, or if it was just automatically added.

I think we should either not have a default repository, or have a good location for it.

Good point, I forgot about that. There's probably a better location, I have to check if there are conventions for that stuff. We could do that later and not add a default repository for the initial merge. But I will probably do this pre-merge.

I'd propose Documents/Blender/assets.blend or Documents/Blender/Assets/ as default repository. Think it's good to have one to help understanding the design. Although for 2.93 there should be the bundled assets too of course.

Another thing, I'm still in favor of the term Library over Repository, together with some other naming changes proposed in the last section in T82015. We'd have to make that switch now to avoid compatibility issues later.
It should probably be "Asset Library" then to avoid confusion with library data-blocks. I think that libraries and asset repositories are kind of the same thing anyway: the source of some data-blocks/assets. It's just that only when linking data, we create this data-block to permanently reference that library/repository.

I'd propose Documents/Blender/assets.blend or Documents/Blender/Assets/ as default repository. Think it's good to have one to help understanding the design. Although for 2.93 there should be the bundled assets too of course.

It seems reasonable to me. I think the location would be either that, or XDG_DATA_HOME / AppData / /Users/.../Library. The latter is quite hidden though, not something a users can easily browse to.

For the implementation, I'm also thinking that we should not write the path into the preference, but rather have it a something you enable / disable? I imagine there would also be a way to enable / disable the bundled repo as well.

The reason being that if you e.g. change your username, migrate to another computer, or move your documents to be managed by onedrive, the path that is now written in the preferences will no longer be the standard documents folder. And writing to that folder will start failing (which I think we will be doing at some point) for easier asset creation.

Another thing, I'm still in favor of the term Library over Repository, together with some other naming changes proposed in the last section in T82015. We'd have to make that switch now to avoid compatibility issues later.

Asset Library as a name is fine with me.

It seems reasonable to me. I think the location would be either that, or XDG_DATA_HOME / AppData / /Users/.../Library. The latter is quite hidden though, not something a users can easily browse to.

I'd prefer it to be easy to browse too. We also discussed in the UI meeting today, Documents/Blender/Assets/ it is.

For the implementation, I'm also thinking that we should not write the path into the preference, but rather have it a something you enable / disable? I imagine there would also be a way to enable / disable the bundled repo as well.

The reason being that if you e.g. change your username, migrate to another computer, or move your documents to be managed by onedrive, the path that is now written in the preferences will no longer be the standard documents folder. And writing to that folder will start failing (which I think we will be doing at some point) for easier asset creation.

I could do that change, but so far I'm not convinced it's useful. If the location of your assets changes, you can just change the path in the Preferences. What you suggest seems to make it less useful actually, since you'd have to set up a new path and disable the default one. Maybe I'm misunderstanding.
The main purpose of this default repository is to help users understand the design btw. So they have an external repository to select and see the message with the path it tried to use, and that they can change things via the Preferences.

  • Rename "Repositories" to "Asset Libraries" in code and UI
  • Tweak Asset Libraries panel UI in Preferences (by Hans mostly)
Julian Eisel (Severin) retitled this revision from Asset Browser: Support custom asset repository paths through Preferences to Asset Browser: Support custom asset library paths through Preferences.Dec 10 2020, 1:29 AM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Dec 11 2020, 3:09 PM