WIP: Brush assets project #106303
|
@ -982,16 +982,16 @@ Main *BKE_main_from_id(Main *global_main, const ID *id, const bool verify)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Debug assert, especially for places that pass in G_MAIN. */
|
/* Debug assert, especially for places that pass in G_MAIN. */
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (id->flag & LIB_EMBEDDED_DATA) {
|
if (id->flag & LIB_EMBEDDED_DATA) {
|
||||||
const ID *id_owner = BKE_id_owner_get(const_cast<ID*>(id));
|
const ID *id_owner = BKE_id_owner_get(const_cast<ID *>(id));
|
||||||
BLI_assert(BLI_findindex(which_libbase(global_main, GS(id_owner->name)), id_owner) != -1);
|
BLI_assert(BLI_findindex(which_libbase(global_main, GS(id_owner->name)), id_owner) != -1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BLI_assert(BLI_findindex(which_libbase(global_main, GS(id->name)), id) != -1);
|
BLI_assert(BLI_findindex(which_libbase(global_main, GS(id->name)), id) != -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return global_main;
|
return global_main;
|
||||||
|
|
|
@ -713,18 +713,17 @@ static void add_catalog_tabs(AssetShelf &shelf, uiLayout &layout)
|
||||||
uiItemS(&layout);
|
uiItemS(&layout);
|
||||||
|
|
||||||
/* Regular catalog tabs. */
|
/* Regular catalog tabs. */
|
||||||
settings_foreach_enabled_catalog_path(
|
settings_foreach_enabled_catalog_path(shelf, [&](const asset_system::AssetCatalogPath &path) {
|
||||||
shelf, [&](const asset_system::AssetCatalogPath &path) {
|
uiBut *but = add_tab_button(*block, path.name());
|
||||||
uiBut *but = add_tab_button(*block, path.name());
|
|
||||||
|
|
||||||
UI_but_func_set(but, [&shelf_settings, path](bContext &C) {
|
UI_but_func_set(but, [&shelf_settings, path](bContext &C) {
|
||||||
settings_set_active_catalog(shelf_settings, path);
|
settings_set_active_catalog(shelf_settings, path);
|
||||||
send_redraw_notifier(C);
|
send_redraw_notifier(C);
|
||||||
});
|
});
|
||||||
UI_but_func_pushed_state_set(but, [&shelf_settings, path](const uiBut &) -> bool {
|
UI_but_func_pushed_state_set(but, [&shelf_settings, path](const uiBut &) -> bool {
|
||||||
return settings_is_active_catalog(shelf_settings, path);
|
return settings_is_active_catalog(shelf_settings, path);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
Loading…
Reference in New Issue