Blender V5.3
blender::ed::asset Namespace Reference

Namespaces

namespace  index
namespace  list
namespace  shelf

Classes

class  AssetClearHelper
struct  AssetFilterSettings
struct  AssetItemTree
struct  AssetLibraryAndRef
class  AssetMarkHelper
class  AssetTemporaryIDConsumer
struct  FileCheckCallbackInfo
struct  IDVecStats
struct  ImportInstantiateContext
struct  ScreenshotOperatorData

Functions

void catalogs_save_from_main_path (asset_system::AssetLibrary *library, const Main *bmain)
void catalogs_save_from_asset_reference (asset_system::AssetLibrary &library, const AssetWeakReference &reference)
void catalogs_set_save_catalogs_when_file_is_saved (bool should_save)
bool catalogs_get_save_catalogs_when_file_is_saved ()
bool catalogs_read_only (const asset_system::AssetLibrary &library)
asset_system::AssetCatalog * catalog_add (asset_system::AssetLibrary *library, StringRefNull name, StringRef parent_path=nullptr)
void catalog_remove (asset_system::AssetLibrary *library, const asset_system::CatalogID &catalog_id)
void catalog_rename (asset_system::AssetLibrary *library, asset_system::CatalogID catalog_id, StringRefNull new_name)
void catalog_move (asset_system::AssetLibrary *library, asset_system::CatalogID src_catalog_id, std::optional< asset_system::CatalogID > dst_parent_catalog_id=std::nullopt)
bool filter_matches_asset (const AssetFilterSettings *filter, const asset_system::AssetRepresentation &asset)
asset_system::AssetCatalogTree build_filtered_catalog_tree (const asset_system::AssetLibrary &library, const AssetLibraryReference &library_ref, FunctionRef< bool(const asset_system::AssetRepresentation &)> is_asset_visible_fn)
AssetItemTree build_filtered_all_catalog_tree (const AssetLibraryReference &library_ref, const bContext &C, const AssetFilterSettings &filter_settings, FunctionRef< bool(const AssetMetaData &)> meta_data_filter={}, const std::optional< StringRef > skip_prefix=std::nullopt)
ID * asset_local_id_ensure_imported (Main &bmain, const asset_system::AssetRepresentation &asset, int flags=0, const std::optional< eAssetImportMethod > import_method=std::nullopt, const std::optional< ImportInstantiateContext > instantiate_context=std::nullopt, ReportList *reports=nullptr)
int library_reference_to_enum_value (const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value (int value)
const EnumPropertyItem * library_reference_to_rna_enum_itemf (bool include_readonly, bool include_current_file, bool include_remote_libraries, bool include_separate_online_essentials)
const EnumPropertyItem * custom_libraries_rna_enum_itemf ()
asset_system::AssetCatalog & library_ensure_catalogs_in_path (asset_system::AssetLibrary &library, const asset_system::AssetCatalogPath &path)
AssetLibraryReference user_library_to_library_ref (const bUserAssetLibrary &user_library)
void refresh_asset_library (const bContext *C, const AssetLibraryReference &library_ref)
void refresh_asset_library (const bContext *C, const bUserAssetLibrary &user_library)
void refresh_asset_library_from_asset (const bContext *C, const asset_system::AssetRepresentation &asset)
bool mark_id (ID *id)
void generate_preview (const bContext *C, ID *id)
bool clear_id (ID *id)
bool copy_to_id (const AssetMetaData *asset_data, ID *destination)
void pre_save_assets (Main *bmain)
bool can_mark_single_from_context (const bContext *C)
AssetTempIDConsumer * temp_id_consumer_create (const asset_system::AssetRepresentation *asset)
void temp_id_consumer_free (AssetTempIDConsumer **consumer)
ID * temp_id_consumer_ensure_local_id (AssetTempIDConsumer *consumer, ID_Type id_type, Main *bmain, ReportList *reports)
bool id_type_is_non_experimental (const ID *id)
bool id_type_is_supported (const ID *id)
int64_t types_supported_as_filter_flags ()
static std::string catalog_name_ensure_unique (AssetCatalogService &catalog_service, StringRefNull name, StringRef parent_path)
void catalog_move (AssetLibrary *library, const CatalogID src_catalog_id, const std::optional< CatalogID > dst_parent_catalog_id)
asset_system::AssetCatalogTree build_filtered_catalog_tree (const asset_system::AssetLibrary &library, const AssetLibraryReference &library_ref, const FunctionRef< bool(const asset_system::AssetRepresentation &)> is_asset_visible_fn)
static asset_system::AssetCatalogPath catalog_path_skipped_prefix (const asset_system::AssetCatalogPath &full_path, const std::optional< StringRef > skip_prefix)
AssetItemTree build_filtered_all_catalog_tree (const AssetLibraryReference &library_ref, const bContext &C, const AssetFilterSettings &filter_settings, const FunctionRef< bool(const AssetMetaData &)> meta_data_filter, const std::optional< StringRef > skip_prefix)
static bool custom_library_is_valid (const bUserAssetLibrary *user_library)
static void rna_enum_add_custom_libraries (EnumPropertyItem **item, int *totitem, const bool include_remote_libraries)
static asset_system::AssetCatalog & library_ensure_catalog (asset_system::AssetLibrary &library, const asset_system::AssetCatalogPath &path)
void operator_asset_reference_props_register (StructRNA &srna)
void operator_asset_reference_props_set (const asset_system::AssetRepresentation &asset, PointerRNA &ptr)
bool operator_asset_reference_props_is_set (PointerRNA &ptr)
static const asset_system::AssetRepresentation * get_local_asset_from_weak_ref (const bContext &C, const AssetWeakReference &weak_ref, ReportList *reports)
const asset_system::AssetRepresentation * find_asset_from_weak_ref (const bContext &C, const AssetWeakReference &weak_ref, ReportList *reports)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library (const bContext &C, PointerRNA &ptr, ReportList *reports)
void draw_menu_for_catalog (const asset_system::AssetCatalogTreeItem &item, const StringRefNull menu_name, ui::Layout &layout)
void draw_node_menu_for_catalog (const asset_system::AssetCatalogTreeItem &item, const StringRefNull operator_id, const StringRefNull menu_name, ui::Layout &layout)
void draw_asset_menu_item (const asset_system::AssetRepresentation *asset, ui::Layout &layout, FunctionRef< void(ui::Layout &, BIFIconID)> draw_item_fn)
void draw_asset_menu_item (const asset_system::AssetRepresentation *asset, StringRefNull opname, const wm::OpCallContext operator_call_context, ui::Layout &layout)
static IDVecStats asset_operation_get_id_vec_stats_from_ids (const Span< PointerRNA > id_pointers)
static const char * asset_operation_unsupported_type_msg (const bool is_single)
static wmOperatorStatus asset_mark_exec (const bContext *C, const wmOperator *op, const Span< PointerRNA > ids)
static bool asset_mark_poll (bContext *C, const Span< PointerRNA > ids)
static void ASSET_OT_mark (wmOperatorType *ot)
static void ASSET_OT_mark_single (wmOperatorType *ot)
static wmOperatorStatus asset_clear_exec (const bContext *C, const wmOperator *op, const Span< PointerRNA > ids)
static bool asset_clear_poll (bContext *C, const Span< PointerRNA > ids)
static std::string asset_clear_get_description (bContext *, wmOperatorType *, PointerRNA *ptr)
static void ASSET_OT_clear (wmOperatorType *ot)
static void ASSET_OT_clear_single (wmOperatorType *ot)
static bool asset_library_refresh_poll (bContext *C)
static void do_asset_library_refresh (bContext *C)
static std::optional< AssetLibraryAndRef > asset_library_from_context (bContext *C)
static wmOperatorStatus asset_library_reload_listing_exec (bContext *C, wmOperator *op)
static bool asset_library_reload_listing_poll (bContext *C)
static void ASSET_OT_library_reload_listing (wmOperatorType *ot)
static wmOperatorStatus asset_library_refresh_exec (bContext *C, wmOperator *op)
static wmOperatorStatus asset_library_refresh_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static std::string asset_library_refresh_get_description (bContext *, wmOperatorType *ot, PointerRNA *ptr)
static void ASSET_OT_library_refresh (wmOperatorType *ot)
static bool asset_catalog_operator_poll (bContext *C)
static wmOperatorStatus asset_catalog_new_exec (bContext *C, wmOperator *op)
static void ASSET_OT_catalog_new (wmOperatorType *ot)
static wmOperatorStatus asset_catalog_delete_exec (bContext *C, wmOperator *op)
static void ASSET_OT_catalog_delete (wmOperatorType *ot)
static asset_system::AssetCatalogService * get_catalog_service (bContext *C)
static wmOperatorStatus asset_catalog_undo_exec (bContext *C, wmOperator *)
static bool asset_catalog_undo_poll (bContext *C)
static void ASSET_OT_catalog_undo (wmOperatorType *ot)
static wmOperatorStatus asset_catalog_redo_exec (bContext *C, wmOperator *)
static bool asset_catalog_redo_poll (bContext *C)
static void ASSET_OT_catalog_redo (wmOperatorType *ot)
static wmOperatorStatus asset_catalog_undo_push_exec (bContext *C, wmOperator *)
static bool asset_catalog_undo_push_poll (bContext *C)
static void ASSET_OT_catalog_undo_push (wmOperatorType *ot)
static bool asset_catalogs_save_poll (bContext *C)
static wmOperatorStatus asset_catalogs_save_exec (bContext *C, wmOperator *)
static void ASSET_OT_catalogs_save (wmOperatorType *ot)
static bool could_be_asset_bundle (const Main *bmain)
static const bUserAssetLibrary * selected_asset_library (wmOperator *op)
static bool is_contained_in_selected_asset_library (wmOperator *op, const char *filepath)
static bool set_filepath_for_asset_lib (const Main *bmain, wmOperator *op)
static bool has_external_files (Main *bmain, ReportList *reports)
static bool asset_bundle_install_poll (bContext *C)
static wmOperatorStatus asset_bundle_install_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus asset_bundle_install_exec (bContext *C, wmOperator *op)
static const EnumPropertyItem * rna_asset_library_reference_itemf (bContext *, PointerRNA *, PropertyRNA *, bool *r_free)
static void ASSET_OT_bundle_install (wmOperatorType *ot)
static bool external_file_check_callback (BPathForeachPathData *bpath_data, char *, size_t, const char *path_src)
static void sort_points (int2 &p1, int2 &p2)
static int2 clamp_point_to_window (const int2 &point, const wmWindow *window)
static void square_points_clamp_to_window (const int2 &p1, int2 &p2, const wmWindow *window)
static void generate_previewimg_from_buffer (ID *id, const ImBuf *image_buffer)
static ImBuf * take_screenshot_crop (bContext *C, const rcti &crop_rect)
static wmOperatorStatus screenshot_preview_exec (bContext *C, wmOperator *op)
static void screenshot_preview_draw (const wmWindow *window, void *operator_data)
static void screenshot_preview_exit (bContext *C, wmOperator *op)
static void screenshot_area_transfer_to_rna (wmOperator *op, ScreenshotOperatorData *data)
static wmOperatorStatus screenshot_preview_modal (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus screenshot_preview_invoke (bContext *C, wmOperator *op, const wmEvent *)
static bool screenshot_preview_poll (bContext *C)
static void ASSET_OT_screenshot_preview (wmOperatorType *ot)
static Vector< const asset_system::AssetRepresentation * > selected_or_active_assets (const bContext *C)
static bool assets_download_any_poll (bContext *C)
static bool assets_download_poll (bContext *C)
static wmOperatorStatus assets_download_exec (bContext *C, wmOperator *op)
static void ASSET_OT_assets_download (wmOperatorType *ot)
static wmOperatorStatus asset_download_exec (bContext *C, wmOperator *op)
static void ASSET_OT_asset_download (wmOperatorType *ot)
static bool external_asset_rename_poll (bContext *C)
static wmOperatorStatus external_asset_rename_exec (bContext *C, wmOperator *op)
static wmOperatorStatus external_asset_rename_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void ASSET_OT_external_asset_rename (wmOperatorType *ot)
void operatortypes_asset ()
void asset_tooltip (const asset_system::AssetRepresentation &asset, ui::TooltipData &tip, const bool include_name)
BIFIconID asset_preview_icon_id (const asset_system::AssetRepresentation &asset)
BIFIconID asset_preview_or_icon (const asset_system::AssetRepresentation &asset)
const bUserAssetLibrary * get_asset_library_from_opptr (PointerRNA &ptr)
AssetLibraryReference get_asset_library_ref_from_opptr (PointerRNA &ptr)
std::optional< AssetLibraryReference > get_user_library_ref_for_save (const asset_system::AssetLibrary *preferred_library)
void visit_library_catalogs_catalog_for_search (const Main &bmain, const AssetLibraryReference lib, const StringRef edit_text, const FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)

Variables

constexpr int DRAG_THRESHOLD = 4

Function Documentation

◆ asset_bundle_install_exec()

◆ asset_bundle_install_invoke()

◆ asset_bundle_install_poll()

◆ asset_catalog_delete_exec()

◆ asset_catalog_new_exec()

◆ asset_catalog_operator_poll()

◆ asset_catalog_redo_exec()

◆ asset_catalog_redo_poll()

bool blender::ed::asset::asset_catalog_redo_poll ( bContext * C)
static

◆ asset_catalog_undo_exec()

◆ asset_catalog_undo_poll()

bool blender::ed::asset::asset_catalog_undo_poll ( bContext * C)
static

◆ asset_catalog_undo_push_exec()

◆ asset_catalog_undo_push_poll()

bool blender::ed::asset::asset_catalog_undo_push_poll ( bContext * C)
static

◆ asset_catalogs_save_exec()

◆ asset_catalogs_save_poll()

◆ asset_clear_exec()

◆ asset_clear_get_description()

std::string blender::ed::asset::asset_clear_get_description ( bContext * ,
wmOperatorType * ,
PointerRNA * ptr )
static

◆ asset_clear_poll()

◆ asset_download_exec()

◆ asset_library_from_context()

std::optional< AssetLibraryAndRef > blender::ed::asset::asset_library_from_context ( bContext * C)
static

◆ asset_library_refresh_exec()

◆ asset_library_refresh_get_description()

std::string blender::ed::asset::asset_library_refresh_get_description ( bContext * ,
wmOperatorType * ot,
PointerRNA * ptr )
static

◆ asset_library_refresh_invoke()

◆ asset_library_refresh_poll()

◆ asset_library_reload_listing_exec()

◆ asset_library_reload_listing_poll()

◆ asset_local_id_ensure_imported()

ID * blender::ed::asset::asset_local_id_ensure_imported ( Main & bmain,
const asset_system::AssetRepresentation & asset,
int flags = 0,
const std::optional< eAssetImportMethod > import_method = std::nullopt,
const std::optional< ImportInstantiateContext > instantiate_context = std::nullopt,
ReportList * reports = nullptr )

If the asset already has a corresponding local ID, return it. Otherwise, link or append the asset's data-block, using "Append & Reuse" if the method is unspecified.

Note
This can return null! Importing can fail if the asset was deleted or moved since the asset library was loaded.
Parameters
import_methodOverrides library's default importing method. If not set and the library has no default, ASSET_IMPORT_APPEND_REUSE will be used.

Definition at line 21 of file asset_import.cc.

References blender::ASSET_IMPORT_APPEND, blender::ASSET_IMPORT_APPEND_REUSE, blender::ASSET_IMPORT_LINK, blender::ASSET_IMPORT_PACK, asset_local_id_ensure_imported(), BLI_assert_unreachable, blender::BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR, blender::BLO_LIBLINK_APPEND_LOCAL_ID_REUSE, blender::BLO_LIBLINK_APPEND_RECURSIVE, blender::BLO_LIBLINK_PACK, blender::FILE_RELPATH, blender::U, blender::WM_file_append_datablock(), and blender::WM_file_link_datablock().

Referenced by blender::ed::object::add_essential_asset_modifier(), blender::ed::space_node::add_node_group_asset(), asset_local_id_ensure_imported(), blender::ed::geometry::get_asset_or_local_node_group(), blender::ed::object::get_asset_or_local_node_group(), blender::ed::vse::get_asset_or_local_node_group(), blender::get_asset_or_local_node_group(), blender::ed::space_node::node_swap_group_asset_invoke(), blender::ed::space_node::search_link_ops_for_asset_metadata(), blender::ed::vse::sequencer_add_scene_asset(), blender::ed::object::shade_auto_smooth_exec(), and blender::WM_drag_asset_id_import().

◆ asset_mark_exec()

◆ asset_mark_poll()

◆ asset_operation_get_id_vec_stats_from_ids()

IDVecStats blender::ed::asset::asset_operation_get_id_vec_stats_from_ids ( const Span< PointerRNA > id_pointers)
static

◆ asset_operation_unsupported_type_msg()

const char * blender::ed::asset::asset_operation_unsupported_type_msg ( const bool is_single)
static

◆ ASSET_OT_asset_download()

◆ ASSET_OT_assets_download()

◆ ASSET_OT_bundle_install()

◆ ASSET_OT_catalog_delete()

◆ ASSET_OT_catalog_new()

◆ ASSET_OT_catalog_redo()

◆ ASSET_OT_catalog_undo()

◆ ASSET_OT_catalog_undo_push()

◆ ASSET_OT_catalogs_save()

◆ ASSET_OT_clear()

◆ ASSET_OT_clear_single()

◆ ASSET_OT_external_asset_rename()

◆ ASSET_OT_library_refresh()

◆ ASSET_OT_library_reload_listing()

◆ ASSET_OT_mark()

◆ ASSET_OT_mark_single()

◆ ASSET_OT_screenshot_preview()

◆ asset_preview_icon_id()

BIFIconID blender::ed::asset::asset_preview_icon_id ( const asset_system::AssetRepresentation & asset)

◆ asset_preview_or_icon()

◆ asset_tooltip()

◆ assets_download_any_poll()

bool blender::ed::asset::assets_download_any_poll ( bContext * C)
static

◆ assets_download_exec()

◆ assets_download_poll()

◆ build_filtered_all_catalog_tree() [1/2]

◆ build_filtered_all_catalog_tree() [2/2]

AssetItemTree blender::ed::asset::build_filtered_all_catalog_tree ( const AssetLibraryReference & library_ref,
const bContext & C,
const AssetFilterSettings & filter_settings,
FunctionRef< bool(const AssetMetaData &)> meta_data_filter = {},
const std::optional< StringRef > skip_prefix = std::nullopt )

◆ build_filtered_catalog_tree() [1/2]

◆ build_filtered_catalog_tree() [2/2]

◆ can_mark_single_from_context()

◆ catalog_add()

◆ catalog_move() [1/2]

void blender::ed::asset::catalog_move ( asset_system::AssetLibrary * library,
asset_system::CatalogID src_catalog_id,
std::optional< asset_system::CatalogID > dst_parent_catalog_id = std::nullopt )

Reinsert catalog identified by src_catalog_id as child to catalog identified by dst_parent_catalog_id. If dst_parent_catalog_id is not set, the catalog is moved to the root level of the tree. The name of the reinserted catalog is made unique within the parent. Note that moving a catalog to the same level it was before will also change its name, since the name uniqueness check isn't smart enough to ignore the item to be reinserted. So the caller is expected to handle this case to avoid unwanted renames.

Nothing is done (debug builds run into an assert) if the given catalog IDs can't be identified.

References catalog_move().

Referenced by catalog_move(), catalog_move(), and blender::ed::asset_browser::AssetCatalogDropTarget::drop_asset_catalog_into_catalog().

◆ catalog_move() [2/2]

◆ catalog_name_ensure_unique()

◆ catalog_path_skipped_prefix()

◆ catalog_remove()

◆ catalog_rename()

◆ catalogs_get_save_catalogs_when_file_is_saved()

◆ catalogs_read_only()

bool blender::ed::asset::catalogs_read_only ( const asset_system::AssetLibrary & library)
nodiscard

◆ catalogs_save_from_asset_reference()

◆ catalogs_save_from_main_path()

◆ catalogs_set_save_catalogs_when_file_is_saved()

void blender::ed::asset::catalogs_set_save_catalogs_when_file_is_saved ( bool should_save)

Saving catalog edits when the file is saved is a global option shared for each asset library, and as such ignores the per asset library catalogs_read_only().

Definition at line 188 of file editors/asset/intern/asset_catalog.cc.

References catalogs_set_save_catalogs_when_file_is_saved(), and blender::asset_system::AssetLibrary::save_catalogs_when_file_is_saved.

Referenced by catalogs_set_save_catalogs_when_file_is_saved(), and blender::save_catalogs_when_file_is_closed_set_fn().

◆ clamp_point_to_window()

int2 blender::ed::asset::clamp_point_to_window ( const int2 & point,
const wmWindow * window )
inlinestatic

◆ clear_id()

bool blender::ed::asset::clear_id ( ID * id)

Remove the asset metadata, turning the ID into a "normal" ID.

This clears the Fake User. If for some reason the data-block is meant to be saved anyway, the caller is responsible for explicitly setting the Fake User.

Returns
whether the asset metadata was actually removed; false when the ID was not an asset.

Definition at line 74 of file asset_mark_clear.cc.

References blender::IDTypeInfo::asset_type_info, blender::BKE_asset_metadata_free(), blender::BKE_idtype_get_info_from_id(), clear_id(), blender::id_fake_user_clear(), and blender::ed::asset::list::storage_tag_main_data_dirty().

Referenced by clear_id(), blender::ed::asset::AssetClearHelper::operator()(), and blender::ed::animrig::pose_asset_delete_exec().

◆ copy_to_id()

bool blender::ed::asset::copy_to_id ( const AssetMetaData * asset_data,
ID * destination )

Copy the asset metadata to the given destination ID.

The copy is assigned to destination, any pre-existing asset metadata is freed before that. If destination was not yet marked as asset, it will be after this call.

Returns
true when the copy succeeded, false otherwise. The only reason for failure is when destination is of a type that cannot be an asset.

Definition at line 122 of file asset_mark_clear.cc.

References blender::ID::asset_data, blender::BKE_asset_metadata_copy(), blender::BKE_asset_metadata_free(), blender::BKE_id_can_be_asset(), and copy_to_id().

Referenced by copy_to_id().

◆ could_be_asset_bundle()

bool blender::ed::asset::could_be_asset_bundle ( const Main * bmain)
static

◆ custom_libraries_rna_enum_itemf()

const EnumPropertyItem * blender::ed::asset::custom_libraries_rna_enum_itemf ( )

Same as library_reference_to_rna_enum_itemf(), but only includes custom on-disk asset libraries (libraries on disk, configured in the Preferences). Online asset libraries will be excluded, their on-disk location is just a cache.

Definition at line 193 of file asset_library_reference_enum.cc.

References custom_libraries_rna_enum_itemf(), rna_enum_add_custom_libraries(), and blender::RNA_enum_item_end().

Referenced by custom_libraries_rna_enum_itemf(), and rna_asset_library_reference_itemf().

◆ custom_library_is_valid()

◆ do_asset_library_refresh()

◆ draw_asset_menu_item() [1/2]

void blender::ed::asset::draw_asset_menu_item ( const asset_system::AssetRepresentation * asset,
StringRefNull opname,
const wm::OpCallContext operator_call_context,
ui::Layout & layout )

◆ draw_asset_menu_item() [2/2]

void blender::ed::asset::draw_asset_menu_item ( const asset_system::AssetRepresentation * asset,
ui::Layout & layout,
FunctionRef< void(ui::Layout &, BIFIconID)> draw_item_fn )

Overload that allows adding the actual menu item button in a callback, with a layout prepared for listing assets.

Parameters
draw_item_fnThe function to insert the button. The passed layout will have the asset context pointer assigned so the context menu can show operations (like "Download Asset"), and the layout will be grayed out in case the asset needs downloading. The passed icon represents the online asset status.

Definition at line 166 of file asset_menu_utils.cc.

References blender::ui::Layout::context_ptr_set(), draw_asset_menu_item(), blender::ui::Layout::enabled_set(), blender::asset_system::NO_MATCH, blender::RNA_pointer_create_discrete(), and blender::ui::Layout::row().

Referenced by blender::ed::geometry::add_node_group_operator_button(), blender::catalog_assets_draw(), blender::ed::object::catalog_assets_draw(), blender::ed::vse::catalog_assets_draw(), draw_asset_menu_item(), draw_asset_menu_item(), blender::ed::space_node::node_catalog_assets_draw(), blender::ed::space_node::node_unassigned_assets_draw(), blender::ed::object::unassigned_assets_draw(), blender::ed::vse::unassigned_assets_draw(), and blender::unassigned_assets_draw().

◆ draw_menu_for_catalog()

◆ draw_node_menu_for_catalog()

◆ external_asset_rename_exec()

◆ external_asset_rename_invoke()

◆ external_asset_rename_poll()

◆ external_file_check_callback()

◆ filter_matches_asset()

bool blender::ed::asset::filter_matches_asset ( const AssetFilterSettings * filter,
const asset_system::AssetRepresentation & asset )

Compare asset against the settings of filter.

Individual filter parameters are ORed with the asset properties. That means:

  • The asset type must be one of the ID types filtered by, and
  • The asset must contain at least one of the tags filtered by. However for an asset to be matching it must have one match in each of the parameters. I.e. one matching type and at least one matching tag.
Returns
True if the asset should be visible with these filter settings (parameters match). Otherwise returns false (mismatch).

Definition at line 25 of file asset_filter.cc.

References blender::BKE_idtype_idcode_to_idfilter(), blender::BLI_findstring(), filter_matches_asset(), blender::AssetTag::name, offsetof, and blender::AssetMetaData::tags.

Referenced by build_filtered_all_catalog_tree(), filter_matches_asset(), and blender::ed::space_node::gather_search_link_ops_for_all_assets().

◆ find_asset_from_weak_ref()

const asset_system::AssetRepresentation * blender::ed::asset::find_asset_from_weak_ref ( const bContext & C,
const AssetWeakReference & weak_ref,
ReportList * reports )

◆ generate_preview()

◆ generate_previewimg_from_buffer()

◆ get_asset_library_from_opptr()

◆ get_asset_library_ref_from_opptr()

AssetLibraryReference blender::ed::asset::get_asset_library_ref_from_opptr ( PointerRNA & ptr)

◆ get_catalog_service()

◆ get_local_asset_from_weak_ref()

◆ get_user_library_ref_for_save()

◆ has_external_files()

◆ id_type_is_non_experimental()

bool blender::ed::asset::id_type_is_non_experimental ( const ID * id)

◆ id_type_is_supported()

bool blender::ed::asset::id_type_is_supported ( const ID * id)

Check if the asset type for id (which doesn't need to be an asset right now) can be an asset, respecting the "Extended Asset Browser" experimental feature flag.

Definition at line 26 of file asset_type.cc.

References blender::BKE_id_can_be_asset(), id_type_is_non_experimental(), id_type_is_supported(), blender::U, and USER_EXPERIMENTAL_TEST.

Referenced by asset_operation_get_id_vec_stats_from_ids(), can_mark_single_from_context(), and id_type_is_supported().

◆ is_contained_in_selected_asset_library()

bool blender::ed::asset::is_contained_in_selected_asset_library ( wmOperator * op,
const char * filepath )
static

◆ library_ensure_catalog()

◆ library_ensure_catalogs_in_path()

◆ library_reference_from_enum_value()

◆ library_reference_to_enum_value()

int blender::ed::asset::library_reference_to_enum_value ( const AssetLibraryReference * library)

◆ library_reference_to_rna_enum_itemf()

const EnumPropertyItem * blender::ed::asset::library_reference_to_rna_enum_itemf ( bool include_readonly,
bool include_current_file,
bool include_remote_libraries,
bool include_separate_online_essentials )

Translate all available asset libraries to an RNA enum, whereby the enum values match the result of library_reference_to_enum_value() for any given library.

Since this is meant for UI display, skips non-displayable libraries, that is, libraries with an empty name or path.

Parameters
include_readonlyIf set, the "All" and "Essentials" asset libraries will be added, which cannot be written to.
include_current_fileIf set, "Current File" asset library will be added.
include_remote_librariesIf set, all online asset libraries with a URL set will be added.
include_separate_online_essentialsIf set, the online essentials will be added as a separate library from the normal Essentials. Usually they are a part of the normal Essentials library.

Definition at line 147 of file asset_library_reference_enum.cc.

References blender::ASSET_LIBRARY_ALL, blender::ASSET_LIBRARY_ESSENTIALS, blender::ASSET_LIBRARY_LOCAL, blender::ASSET_LIBRARY_ONLINE_ESSENTIALS, blender::BLI_assert(), library_reference_to_rna_enum_itemf(), rna_enum_add_custom_libraries(), blender::rna_enum_asset_library_type_items, blender::RNA_enum_item_add(), blender::RNA_enum_item_add_separator(), blender::RNA_enum_item_end(), and blender::RNA_enum_items_add().

Referenced by library_reference_to_rna_enum_itemf(), blender::ed::animrig::rna_asset_library_reference_itemf(), and blender::ed::sculpt_paint::rna_asset_library_reference_itemf().

◆ mark_id()

◆ operator_asset_reference_props_get_asset_from_all_library()

const asset_system::AssetRepresentation * blender::ed::asset::operator_asset_reference_props_get_asset_from_all_library ( const bContext & C,
PointerRNA & ptr,
ReportList * reports )

Load all asset libraries to find an asset from the operator_asset_reference_props_register properties. The loading happens in the background, so there may be no result immediately. In that case an "Asset loading is unfinished" report is added.

Note
Does not check asset type or meta data.

Definition at line 134 of file asset_menu_utils.cc.

References blender::AssetWeakReference::asset_library_identifier, blender::AssetWeakReference::asset_library_type, C, find_asset_from_weak_ref(), operator_asset_reference_props_get_asset_from_all_library(), blender::AssetWeakReference::relative_asset_identifier, blender::RNA_enum_get(), and blender::RNA_string_get_alloc().

Referenced by blender::add_compositor_effect_node_group_asset_get_description(), asset_download_exec(), blender::ed::sculpt_paint::brush_asset_activate_exec(), blender::ed::object::get_asset_or_local_node_group(), blender::ed::vse::get_asset_or_local_node_group(), blender::get_asset_or_local_node_group(), blender::handle_operator_asset_reference_props(), blender::ed::object::modifier_add_asset_get_description(), blender::ed::space_node::node_add_group_asset_get_description(), blender::ed::space_node::node_add_group_asset_invoke(), blender::ed::space_node::node_swap_group_asset_invoke(), operator_asset_reference_props_get_asset_from_all_library(), blender::poselib_blend_init_get_action(), blender::ed::vse::sequencer_add_scene_asset_get_description(), blender::ed::vse::sequencer_add_scene_asset_invoke(), and blender::ed::vse::strip_modifier_add_asset_get_description().

◆ operator_asset_reference_props_is_set()

◆ operator_asset_reference_props_register()

◆ operator_asset_reference_props_set()

◆ operatortypes_asset()

◆ pre_save_assets()

void blender::ed::asset::pre_save_assets ( Main * bmain)

◆ refresh_asset_library() [1/2]

◆ refresh_asset_library() [2/2]

void blender::ed::asset::refresh_asset_library ( const bContext * C,
const bUserAssetLibrary & user_library )

Definition at line 70 of file asset_library_utils.cc.

References C, refresh_asset_library(), and user_library_to_library_ref().

◆ refresh_asset_library_from_asset()

◆ rna_asset_library_reference_itemf()

const EnumPropertyItem * blender::ed::asset::rna_asset_library_reference_itemf ( bContext * ,
PointerRNA * ,
PropertyRNA * ,
bool * r_free )
static

◆ rna_enum_add_custom_libraries()

◆ screenshot_area_transfer_to_rna()

void blender::ed::asset::screenshot_area_transfer_to_rna ( wmOperator * op,
ScreenshotOperatorData * data )
inlinestatic

◆ screenshot_preview_draw()

◆ screenshot_preview_exec()

wmOperatorStatus blender::ed::asset::screenshot_preview_exec ( bContext * C,
wmOperator * op )
static

Definition at line 1298 of file asset_ops.cc.

References blender::bke::asset_edit_id_from_weak_reference(), blender::bke::asset_edit_id_is_writable(), blender::bke::asset_edit_id_save(), blender::BKE_area_find_region_type(), blender::BKE_report(), blender::BKE_reportf(), BLI_assert_msg, BLI_assert_unreachable, blender::BLI_rcti_size_x(), blender::BLI_rcti_size_y(), blender::ByteData, C, clamp_point_to_window(), blender::CTX_data_ensure_evaluated_depsgraph(), blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_wm_asset(), blender::CTX_wm_manager(), blender::CTX_wm_window(), blender::ED_area_find_under_cursor(), blender::ED_preview_kill_jobs_for_id(), blender::ED_view3d_draw_offscreen_imbuf(), blender::RenderData::engine, generate_previewimg_from_buffer(), blender::asset_system::AssetRepresentation::get_id_type(), blender::IMB_crop(), blender::IMB_freeImBuf(), blender::asset_system::AssetRepresentation::make_weak_reference(), NA_EDITED, NC_ASSET, ND_ASSET_LIST, blender::OB_RENDER, blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::wmOperator::ptr, blender::Scene::r, blender::R_ALPHAPREMUL, blender::RE_engine_id_BLENDER_EEVEE, blender::RE_engine_id_BLENDER_EEVEE_NEXT, blender::RE_engine_id_BLENDER_WORKBENCH, refresh_asset_library_from_asset(), blender::wmOperator::reports, blender::RGN_TYPE_WINDOW, blender::RNA_boolean_get(), blender::RNA_int_get_array(), blender::RPT_ERROR, screenshot_preview_exec(), blender::View3D::shading, sort_points(), SPACE_TYPE_ANY, blender::SPACE_VIEW3D, blender::ScrArea::spacedata, blender::ScrArea::spacetype, square_points_clamp_to_window(), blender::ed::asset::list::storage_tag_main_data_dirty(), STR_ELEM, take_screenshot_crop(), blender::ScrArea::totrct, blender::View3DShading::type, blender::ARegion::winx, blender::ARegion::winy, blender::WM_main_add_notifier(), blender::rcti::xmin, and blender::rcti::ymin.

Referenced by ASSET_OT_screenshot_preview(), screenshot_preview_exec(), and screenshot_preview_modal().

◆ screenshot_preview_exit()

◆ screenshot_preview_invoke()

◆ screenshot_preview_modal()

◆ screenshot_preview_poll()

◆ selected_asset_library()

◆ selected_or_active_assets()

◆ set_filepath_for_asset_lib()

bool blender::ed::asset::set_filepath_for_asset_lib ( const Main * bmain,
wmOperator * op )
static

◆ sort_points()

void blender::ed::asset::sort_points ( int2 & p1,
int2 & p2 )
inlinestatic

Definition at line 1171 of file asset_ops.cc.

References sort_points().

Referenced by screenshot_preview_draw(), screenshot_preview_exec(), and sort_points().

◆ square_points_clamp_to_window()

void blender::ed::asset::square_points_clamp_to_window ( const int2 & p1,
int2 & p2,
const wmWindow * window )
inlinestatic

◆ take_screenshot_crop()

◆ temp_id_consumer_create()

AssetTempIDConsumer * blender::ed::asset::temp_id_consumer_create ( const asset_system::AssetRepresentation * asset)

◆ temp_id_consumer_ensure_local_id()

ID * blender::ed::asset::temp_id_consumer_ensure_local_id ( AssetTempIDConsumer * consumer,
ID_Type id_type,
Main * bmain,
ReportList * reports )

◆ temp_id_consumer_free()

void blender::ed::asset::temp_id_consumer_free ( AssetTempIDConsumer ** consumer)

◆ types_supported_as_filter_flags()

int64_t blender::ed::asset::types_supported_as_filter_flags ( )

Get the filter flags (subset of FILTER_ID_ALL) representing the asset ID types that may be turned into assets, respecting the "Extended Asset Browser" experimental feature flag.

Note
Does not check for BKE_id_can_be_asset(), so may return filter flags for IDs that can never be assets.

Definition at line 41 of file asset_type.cc.

References ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS, FILTER_ID_ALL, types_supported_as_filter_flags(), blender::U, and USER_EXPERIMENTAL_TEST.

Referenced by blender::file_refresh(), and types_supported_as_filter_flags().

◆ user_library_to_library_ref()

◆ visit_library_catalogs_catalog_for_search()

void blender::ed::asset::visit_library_catalogs_catalog_for_search ( const Main & bmain,
const AssetLibraryReference lib,
StringRef edit_text,
const FunctionRef< void(StringPropertySearchVisitParams)> visit_fn )

Variable Documentation

◆ DRAG_THRESHOLD

int blender::ed::asset::DRAG_THRESHOLD = 4
constexpr

Definition at line 1153 of file asset_ops.cc.

Referenced by screenshot_preview_modal().