Page MenuHome

Add option to link assets on drag & drop
ClosedPublic

Authored by Julian Eisel (Severin) on Jun 8 2021, 6:49 PM.

Details

Summary

Adds the choice for link vs. append to the Asset Browser header. This is
probably gonna be a temporary place, T54642 shows where this could be placed
eventually.

Also includes a fix for the object dropping operator, which would duplicate the
imported asset again. To be committed separately, but it's definitely needed
for this patch to work nicely.

Diff Detail

Repository
rB Blender

Event Timeline

Julian Eisel (Severin) requested review of this revision.Jun 8 2021, 6:49 PM
Julian Eisel (Severin) created this revision.
source/blender/windowmanager/WM_api.h
265–266

Hmm, make format doesn't change this. Maybe my IDE uses a different clang-format version. Please ignore.

Julian Eisel (Severin) added inline comments.
source/blender/blenloader/intern/versioning_300.c
249

Could change it so FILE_ASSET_IMPORT_APPEND has index 0 (but keep it after FILE_ASSET_IMPORT_LINK in the RNA enum). OTOH such a version patch is not a big deal.

patch LGTM, besides picky details noted below.

source/blender/makesdna/DNA_space_types.h
784

Could be a short?

791–793

I know it's tempting to keep it, but would rather nuke those 'might be used in the future' thing from final commit? We have way too many of those in Blender already :|

This revision is now accepted and ready to land.Jun 11 2021, 3:40 PM

This significantly deviates from the original asset browser design, where such linking was only allowed within project repositories. Not between .blend files in arbitrary different directories and repositories.

Is this a temporary thing that is going to be fixed before the release, with maybe some simple way to designate a project repository? Or is will this be unchanged? I think it would be quite bad if users started creating links to bundled assets or other non-project repositories.

I generally agree on avoiding links to user asset libraries, although I can see cases where it may be useful for self managed assets. I think the way to get there may have changed a bit.

First off, the UI design in T54642 always contained a link/append option. I think at least in some cases it would be exposed like this.

Sybren and Francesco decided the link/append behavior should be stored per asset library. I think we can just distinguish between project and user libraries, but I'm looking at that more as an implementation detail. They also decided it should be overridable per asset and ultimately by the user. This may be a bit too much but it seems worth experimenting with.
So how exactly it's done in the end is a bit fuzzy, but we seem to all agree that project libraries should link and user libraries append by default. It makes sense to me to completely forbid linking bundled assets or assets from one project to another.