WIP: Brush assets project #106303

Draft
Julian Eisel wants to merge 358 commits from brush-assets-project into main

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

View File

@ -1328,6 +1328,15 @@ static int brush_asset_update_exec(bContext *C, wmOperator *op)
Brush *brush = nullptr;
const AssetWeakReference *asset_weak_ref =
BKE_paint_brush_asset_get(paint, &brush).value_or(nullptr);
if (!asset_weak_ref) {
return OPERATOR_CANCELLED;
}
const bUserAssetLibrary *user_library = BKE_preferences_asset_library_find_by_name(
&U, asset_weak_ref->asset_library_identifier);
if (!user_library) {
return OPERATOR_CANCELLED;
}
// TODO: maybe can check directly in poll
BLI_assert((brush->id.tag & LIB_TAG_ASSET_MAIN) != 0);
@ -1350,6 +1359,10 @@ static int brush_asset_update_exec(bContext *C, wmOperator *op)
final_full_asset_filepath,
op->reports);
refresh_asset_library(C, *user_library);
WM_main_add_notifier(NC_ASSET | ND_ASSET_LIST | NA_EDITED, nullptr);
WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}