WIP: Brush assets project #106303
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue