UI: Asset Shelf (Experimental Feature) #104831

Closed
Julian Eisel wants to merge 399 commits from asset-shelf into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 6 additions and 15 deletions
Showing only changes of commit 0a741e5759 - Show all commits

View File

@ -164,7 +164,7 @@ typedef struct RegionPollParams {
const struct ScrArea *area;
const struct ARegion *region;
/* Full context, if WM context above is not enough. */
/** Full context, if WM context above is not enough. */
const struct bContext *context;
} RegionPollParams;
@ -421,7 +421,7 @@ typedef struct Menu {
/* #AssetShelfType.flag */
typedef enum AssetShelfTypeFlag {
/** Do not trigger asset dragging on drag events. Drag events can be overridden with custom
keymap items then. */
* keymap items then. */
ASSET_SHELF_TYPE_NO_ASSET_DRAG = (1 << 0),
JulianEisel marked this conversation as resolved Outdated

Suggestion: calling ASSET_SHELF_TYPE_* prefix reads like a type which are typically unique values, not flags. ASSET_SHELF_TYPE_FLAG_NO_ASSET_DRAG - some extra clarity at the expense of verbosity.

Suggestion: calling `ASSET_SHELF_TYPE_*` prefix reads like a type which are typically unique values, not flags. `ASSET_SHELF_TYPE_FLAG_NO_ASSET_DRAG` - some extra clarity at the expense of verbosity.
ASSET_SHELF_TYPE_FLAG_MAX
@ -437,13 +437,14 @@ typedef struct AssetShelfType {
AssetShelfTypeFlag flag;
/* Determine if the asset shelf should be visible or not. */
/** Determine if asset shelves of this type should be available in current context or not. */
bool (*poll)(const struct bContext *C, const struct AssetShelfType *shelf_type);
/* Determine if an individual asset should be visible or not. May be a temporary design,
* visibility should be first and foremost controlled by asset traits. */
/** Determine if an individual asset should be visible or not. May be a temporary design,
* visibility should first and foremost be controlled by asset traits. */
bool (*asset_poll)(const struct AssetShelfType *shelf_type, const struct AssetHandle *asset);
/** Asset shelves can define their own context menu via this layout definition callback. */
void (*draw_context_menu)(const struct bContext *C,
const struct AssetShelfType *shelf_type,
const struct AssetHandle *asset,

View File

@ -198,12 +198,5 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
}
/* Should we really use the "All" library by default? Consider loading time and memory usage.
*/
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
workspace->asset_library_ref.type = ASSET_LIBRARY_ALL;
workspace->asset_library_ref.custom_library_index = -1;
}
}
}

View File

@ -262,9 +262,6 @@ void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_templat
BKE_workspace_tool_remove(workspace, static_cast<bToolRef *>(workspace->tools.first));
}
workspace->asset_library_ref.type = ASSET_LIBRARY_ALL;
workspace->asset_library_ref.custom_library_index = -1;
/* For 2D animation template. */
if (STREQ(workspace->id.name + 2, "Drawing")) {
workspace->object_mode = OB_MODE_PAINT_GPENCIL;