Brush Assets: Show new catalog in asset shelf when duplicating brush #120531
|
@ -88,6 +88,8 @@ void type_unlink(const Main &bmain, const AssetShelfType &shelf_type);
|
|||
int tile_width(const AssetShelfSettings &settings);
|
||||
int tile_height(const AssetShelfSettings &settings);
|
||||
|
||||
AssetShelf *active_shelf_from_area(const ScrArea *area);
|
||||
|
||||
int context(const bContext *C, const char *member, bContextDataResult *result);
|
||||
|
||||
} // namespace blender::ed::asset::shelf
|
||||
|
|
|
@ -562,7 +562,7 @@ void region_blend_write(BlendWriter *writer, ARegion *region)
|
|||
/** \name Asset Shelf Context
|
||||
* \{ */
|
||||
|
||||
static AssetShelf *active_shelf_from_area(const ScrArea *area)
|
||||
AssetShelf *active_shelf_from_area(const ScrArea *area)
|
||||
{
|
||||
const ARegion *shelf_region = BKE_area_find_region_type(area, RGN_TYPE_ASSET_SHELF);
|
||||
if (!shelf_region) {
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "ED_asset_list.hh"
|
||||
#include "ED_asset_mark_clear.hh"
|
||||
#include "ED_asset_menu_utils.hh"
|
||||
#include "ED_asset_shelf.hh"
|
||||
#include "ED_image.hh"
|
||||
#include "ED_paint.hh"
|
||||
#include "ED_screen.hh"
|
||||
|
@ -891,16 +892,9 @@ static void show_catalog_in_asset_shelf(const bContext &C, const StringRefNull c
|
|||
if (!area) {
|
||||
return;
|
||||
}
|
||||
HooglyBoogly marked this conversation as resolved
Outdated
|
||||
const ARegion *shelf_region = BKE_area_find_region_type(area, RGN_TYPE_ASSET_SHELF);
|
||||
if (!shelf_region) {
|
||||
return;
|
||||
}
|
||||
if (shelf_region->flag & RGN_FLAG_POLL_FAILED) {
|
||||
return;
|
||||
}
|
||||
const RegionAssetShelf &shelf = *static_cast<const RegionAssetShelf *>(shelf_region->regiondata);
|
||||
const AssetShelf *shelf = asset::shelf::active_shelf_from_area(area);
|
||||
if (!BKE_preferences_asset_shelf_settings_ensure_catalog_path_enabled(
|
||||
&U, shelf.active_shelf->idname, catalog_path.c_str()))
|
||||
&U, shelf->idname, catalog_path.c_str()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Code here is duplicated from
active_shelf_from_area()
, better make this shared.