63 &meta_data,
"geometry_node_asset_traits_flag");
102 const auto ensure_separator = [&]() {
111 if (skip_essentials) {
132 if (group->id.library_weak_reference || group->id.asset_data) {
135 if (!group->geometry_node_asset_traits ||
158 bool add_separator = !
tree.unassigned_assets.is_empty();
161 if (group->id.library_weak_reference || group->id.asset_data) {
164 if (!group->geometry_node_asset_traits ||
172 add_separator =
false;
197 if (
tree.catalogs.is_empty() && loading_finished) {
203 if (!loading_finished) {
204 layout->
label(
IFACE_(
"Loading Asset Libraries"), ICON_INFO);
236 "OBJECT_MT_add_modifier_unassigned_assets",
IFACE_(
"Unassigned"), ICON_FILE_HIDDEN);
289 bool changed =
false;
342 if (!
asset->get_metadata().description) {
345 return TIP_(
asset->get_metadata().description);
350 ot->name =
"Add Modifier";
351 ot->description =
"Add a procedural operation/effect to the active object";
352 ot->idname =
"OBJECT_OT_modifier_add_node_group";
373 "Modifier node group assets not assigned to a catalog.\n"
374 "Catalogs can be assigned in the Asset Browser");
408 const bool skip_essentials)
422 col->context_int_set(
"skip_essentials", skip_essentials);
423 col->menu_contents(
"OBJECT_MT_add_modifier_catalog_assets");
Main runtime representation of an asset.
IDProperty * BKE_asset_metadata_idprop_find(const AssetMetaData *asset_data, const char *name) ATTR_WARN_UNUSED_RESULT
std::optional< int64_t > CTX_data_int_get(const bContext *C, const char *member)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
std::optional< blender::StringRefNull > CTX_data_string_get(const bContext *C, const char *member)
View3D * CTX_wm_view3d(const bContext *C)
#define IDP_int_get(prop)
void BKE_modifier_unique_name(ListBase *modifiers, ModifierData *md)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define LISTBASE_FOREACH(type, var, list)
#define STRNCPY_UTF8(dst, src)
#define SET_FLAG_FROM_TEST(value, test, flag)
@ ASSET_LIBRARY_ESSENTIALS
@ NODES_MODIFIER_HIDE_DATABLOCK_SELECTOR
@ NODES_MODIFIER_HIDE_MANAGE_PANEL
@ GEO_NODE_ASSET_MODIFIER
@ GEO_NODE_ASSET_HIDE_MODIFIER_MANAGE_PANEL
bool ED_operator_object_active_editable(bContext *C)
void MOD_nodes_update_interface(Object *object, NodesModifierData *nmd)
bool contains(const Key &key) const
void add_new(const Key &key)
constexpr bool is_empty() const
const std::string & str() const
void foreach_child(ItemIterFn callback) const
AssetCatalogPath catalog_path() const
StringRefNull get_name() const
bool has_children() const
void * MEM_dupallocN(const void *vmemh)
AssetLibraryReference all_library_reference()
void all_library_reload_catalogs_if_dirty()
asset_system::AssetLibrary * library_get_once_available(const AssetLibraryReference &library_reference)
bool is_loaded(const AssetLibraryReference *library_reference)
void asset_reading_region_listen_fn(const wmRegionListenerParams *params)
AssetItemTree build_filtered_all_catalog_tree(const AssetLibraryReference &library_ref, const bContext &C, const AssetFilterSettings &filter_settings, FunctionRef< bool(const AssetMetaData &)> meta_data_filter={})
void operator_asset_reference_props_register(StructRNA &srna)
void draw_menu_for_catalog(const asset_system::AssetCatalogTreeItem &item, const StringRefNull menu_name, uiLayout &layout)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library(const bContext &C, PointerRNA &ptr, ReportList *reports)
void operator_asset_reference_props_set(const asset_system::AssetRepresentation &asset, PointerRNA &ptr)
ID * asset_local_id_ensure_imported(Main &bmain, const asset_system::AssetRepresentation &asset, const std::optional< eAssetImportMethod > import_method=std::nullopt)
static void root_catalogs_draw(const bContext *C, Menu *menu)
void modifier_register_use_selected_objects_prop(wmOperatorType *ot)
ModifierData * modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
static void catalog_assets_draw(const bContext *C, Menu *menu)
void object_modifier_add_asset_register()
static wmOperatorStatus modifier_add_asset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bNodeTree * get_asset_or_local_node_group(const bContext &C, PointerRNA &ptr, ReportList *reports)
static void OBJECT_OT_modifier_add_node_group(wmOperatorType *ot)
static wmOperatorStatus modifier_add_asset_exec(bContext *C, wmOperator *op)
static void unassigned_assets_draw(const bContext *C, Menu *menu)
static asset::AssetItemTree * get_static_item_tree()
static MenuType modifier_add_root_catalogs_menu_type()
static bNodeTree * get_node_group(const bContext &C, PointerRNA &ptr, ReportList *reports)
static bool unassigned_local_poll(const Main &bmain)
static MenuType modifier_add_unassigned_assets_menu_type()
static MenuType modifier_add_catalog_assets_menu_type()
static bool all_loading_finished()
static std::string modifier_add_asset_get_description(bContext *C, wmOperatorType *, PointerRNA *ptr)
static asset::AssetItemTree build_catalog_tree(const bContext &C)
Object * context_active_object(const bContext *C)
void ui_template_modifier_asset_menu_items(uiLayout &layout, StringRef catalog_path, bool skip_essentials)
Vector< PointerRNA > modifier_get_edit_objects(const bContext &C, const wmOperator &op)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
struct bNodeTree * node_group
struct GeometryNodeAssetTraits * geometry_node_asset_traits
void label(blender::StringRef name, int icon)
uiLayout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
void menu(MenuType *mt, std::optional< blender::StringRef > name, int icon)
wmEventModifierFlag modifier
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
void WM_operator_properties_id_lookup_set_from_id(PointerRNA *ptr, const ID *id)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)