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

Namespaces

namespace  index
namespace  list
namespace  shelf

Classes

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

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::AssetCatalogcatalog_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 blender::asset_system::AssetRepresentation &asset)
asset_system::AssetCatalogTree build_filtered_catalog_tree (const asset_system::AssetLibrary &library, const AssetLibraryReference &library_ref, blender::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={})
IDasset_local_id_ensure_imported (Main &bmain, const asset_system::AssetRepresentation &asset, const std::optional< eAssetImportMethod > import_method=std::nullopt)
int library_reference_to_enum_value (const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value (int value)
const EnumPropertyItemlibrary_reference_to_rna_enum_itemf (bool include_readonly, bool include_current_file)
const EnumPropertyItemcustom_libraries_rna_enum_itemf ()
blender::asset_system::AssetCataloglibrary_ensure_catalogs_in_path (blender::asset_system::AssetLibrary &library, const blender::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 blender::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 blender::asset_system::AssetRepresentation *asset)
void temp_id_consumer_free (AssetTempIDConsumer **consumer)
IDtemp_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)
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)
static void rna_enum_add_custom_libraries (EnumPropertyItem **item, int *totitem)
static asset_system::AssetCataloglibrary_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::AssetRepresentationget_local_asset_from_relative_identifier (const bContext &C, const StringRefNull relative_identifier, ReportList *reports)
const asset_system::AssetRepresentationfind_asset_from_weak_ref (const bContext &C, const AssetWeakReference &weak_ref, ReportList *reports)
const asset_system::AssetRepresentationoperator_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, uiLayout &layout)
void draw_node_menu_for_catalog (const asset_system::AssetCatalogTreeItem &item, const StringRefNull operator_id, const StringRefNull menu_name, uiLayout &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 wmOperatorStatus asset_library_refresh_exec (bContext *C, wmOperator *)
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::AssetCatalogServiceget_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 bUserAssetLibraryselected_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 EnumPropertyItemrna_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 ImBuftake_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)
void operatortypes_asset ()
void asset_tooltip (const asset_system::AssetRepresentation &asset, uiTooltipData &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 bUserAssetLibraryget_asset_library_from_opptr (PointerRNA &ptr)
AssetLibraryReference get_asset_library_ref_from_opptr (PointerRNA &ptr)
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()

wmOperatorStatus blender::ed::asset::asset_bundle_install_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ asset_bundle_install_poll()

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

◆ asset_catalog_delete_exec()

◆ asset_catalog_new_exec()

◆ asset_catalog_operator_poll()

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

◆ 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()

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

◆ asset_catalog_undo_push_poll()

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

Definition at line 639 of file asset_ops.cc.

References C, and get_catalog_service().

Referenced by ASSET_OT_catalog_undo_push().

◆ asset_catalogs_save_exec()

◆ asset_catalogs_save_poll()

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

◆ asset_clear_exec()

◆ asset_clear_get_description()

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

Definition at line 356 of file asset_ops.cc.

References ptr, RNA_boolean_get(), and TIP_.

Referenced by ASSET_OT_clear(), and ASSET_OT_clear_single().

◆ asset_clear_poll()

◆ asset_library_refresh_exec()

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

◆ asset_library_refresh_poll()

◆ asset_local_id_ensure_imported()

ID * blender::ed::asset::asset_local_id_ensure_imported ( Main & bmain,
const asset_system::AssetRepresentation & asset,
const std::optional< eAssetImportMethod > import_method = std::nullopt )

◆ 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

Helper to report stats about the IDs in context. Operator polls use this, also to report a helpful disabled hint to the user.

Definition at line 74 of file asset_ops.cc.

References BLI_assert, blender::ed::asset::IDVecStats::has_asset, blender::ed::asset::IDVecStats::has_supported_type, ID_IS_ASSET, id_type_is_supported(), blender::ed::asset::IDVecStats::is_single, ptr, RNA_struct_is_ID(), and blender::Span< T >::size().

Referenced by asset_clear_poll(), and asset_mark_poll().

◆ asset_operation_unsupported_type_msg()

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

Definition at line 95 of file asset_ops.cc.

References ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_UI_STRING.

Referenced by asset_clear_poll(), and asset_mark_poll().

◆ ASSET_OT_bundle_install()

◆ ASSET_OT_catalog_delete()

void blender::ed::asset::ASSET_OT_catalog_delete ( wmOperatorType * ot)
static

◆ ASSET_OT_catalog_new()

void blender::ed::asset::ASSET_OT_catalog_new ( wmOperatorType * ot)
static

◆ ASSET_OT_catalog_redo()

void blender::ed::asset::ASSET_OT_catalog_redo ( wmOperatorType * ot)
static

Definition at line 616 of file asset_ops.cc.

References asset_catalog_redo_exec(), asset_catalog_redo_poll(), and ot.

Referenced by operatortypes_asset().

◆ ASSET_OT_catalog_undo()

void blender::ed::asset::ASSET_OT_catalog_undo ( wmOperatorType * ot)
static

Definition at line 586 of file asset_ops.cc.

References asset_catalog_undo_exec(), asset_catalog_undo_poll(), and ot.

Referenced by operatortypes_asset().

◆ ASSET_OT_catalog_undo_push()

void blender::ed::asset::ASSET_OT_catalog_undo_push ( wmOperatorType * ot)
static

◆ ASSET_OT_catalogs_save()

void blender::ed::asset::ASSET_OT_catalogs_save ( wmOperatorType * ot)
static

Definition at line 694 of file asset_ops.cc.

References asset_catalogs_save_exec(), asset_catalogs_save_poll(), and ot.

Referenced by operatortypes_asset().

◆ ASSET_OT_clear()

void blender::ed::asset::ASSET_OT_clear ( wmOperatorType * ot)
static

Variant of ASSET_OT_clear that only works on the "id" context member.

Definition at line 372 of file asset_ops.cc.

References asset_clear_exec(), asset_clear_get_description(), asset_clear_poll(), C, ED_operator_get_ids_from_context_as_vec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_boolean().

Referenced by operatortypes_asset().

◆ ASSET_OT_clear_single()

void blender::ed::asset::ASSET_OT_clear_single ( wmOperatorType * ot)
static

◆ ASSET_OT_library_refresh()

void blender::ed::asset::ASSET_OT_library_refresh ( wmOperatorType * ot)
static

Definition at line 450 of file asset_ops.cc.

References asset_library_refresh_exec(), asset_library_refresh_poll(), and ot.

Referenced by operatortypes_asset().

◆ ASSET_OT_mark()

void blender::ed::asset::ASSET_OT_mark ( wmOperatorType * ot)
static

◆ ASSET_OT_mark_single()

void blender::ed::asset::ASSET_OT_mark_single ( wmOperatorType * ot)
static

Variant of ASSET_OT_mark that only works on the "id" context member.

Definition at line 226 of file asset_ops.cc.

References asset_mark_exec(), asset_mark_poll(), C, ED_operator_single_id_from_context_as_vec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_asset().

◆ ASSET_OT_screenshot_preview()

void blender::ed::asset::ASSET_OT_screenshot_preview ( wmOperatorType * ot)
static

◆ asset_preview_icon_id()

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

Definition at line 80 of file asset_ui_utils.cc.

References BKE_previewimg_is_invalid().

Referenced by asset_preview_or_icon().

◆ asset_preview_or_icon()

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

◆ asset_tooltip()

◆ 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 = {} )

◆ build_filtered_catalog_tree() [1/2]

◆ build_filtered_catalog_tree() [2/2]

◆ can_mark_single_from_context()

bool blender::ed::asset::can_mark_single_from_context ( const bContext * C)

◆ 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.

Referenced by blender::ed::asset_browser::AssetCatalogDropTarget::drop_asset_catalog_into_catalog().

◆ catalog_move() [2/2]

◆ catalog_name_ensure_unique()

std::string blender::ed::asset::catalog_name_ensure_unique ( AssetCatalogService & catalog_service,
StringRefNull name,
StringRef parent_path )
static

◆ catalog_remove()

◆ catalog_rename()

◆ catalogs_get_save_catalogs_when_file_is_saved()

bool blender::ed::asset::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 blender::asset_system::AssetLibrary::save_catalogs_when_file_is_saved.

Referenced by 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 ID::asset_data, IDTypeInfo::asset_type_info, BKE_asset_metadata_free(), BKE_idtype_get_info_from_id(), id_fake_user_clear(), and blender::ed::asset::list::storage_tag_main_data_dirty().

Referenced by 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 ID::asset_data, BKE_asset_metadata_copy(), BKE_asset_metadata_free(), and BKE_id_can_be_asset().

◆ could_be_asset_bundle()

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

Definition at line 860 of file asset_ops.cc.

References Main::filepath.

Referenced by asset_bundle_install_poll().

◆ 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 asset libraries (libraries on disk, configured in the Preferences).

Definition at line 131 of file asset_library_reference_enum.cc.

References rna_enum_add_custom_libraries(), and RNA_enum_item_end().

Referenced by rna_asset_library_reference_itemf().

◆ draw_menu_for_catalog()

◆ draw_node_menu_for_catalog()

◆ external_file_check_callback()

bool blender::ed::asset::external_file_check_callback ( BPathForeachPathData * bpath_data,
char * ,
size_t ,
const char * path_src )
static

◆ filter_matches_asset()

bool blender::ed::asset::filter_matches_asset ( const AssetFilterSettings * filter,
const blender::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 BKE_idtype_idcode_to_idfilter(), BLI_findstring(), filter, LISTBASE_FOREACH, name, offsetof, and AssetMetaData::tags.

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

◆ find_asset_from_weak_ref()

◆ generate_preview()

◆ generate_previewimg_from_buffer()

◆ get_asset_library_from_opptr()

const bUserAssetLibrary * blender::ed::asset::get_asset_library_from_opptr ( PointerRNA & ptr)

◆ get_asset_library_ref_from_opptr()

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

The PointerRNA is expected to have an enum called "asset_library_reference".

Definition at line 109 of file asset_ui_utils.cc.

References library_reference_from_enum_value(), ptr, and RNA_enum_get().

Referenced by blender::ed::sculpt_paint::visit_library_prop_catalogs_catalog_for_search_fn().

◆ get_catalog_service()

◆ get_local_asset_from_relative_identifier()

const asset_system::AssetRepresentation * blender::ed::asset::get_local_asset_from_relative_identifier ( const bContext & C,
const StringRefNull relative_identifier,
ReportList * reports )
static

◆ has_external_files()

◆ id_type_is_non_experimental()

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

Definition at line 19 of file asset_type.cc.

References ELEM, GS, ID_AC, ID_BR, ID_GR, ID_MA, ID_NT, ID_OB, ID_SCE, ID_WO, and ID::name.

Referenced by id_type_is_supported().

◆ 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 BKE_id_can_be_asset(), id_type_is_non_experimental(), U, and USER_EXPERIMENTAL_TEST.

Referenced by asset_operation_get_id_vec_stats_from_ids(), and can_mark_single_from_context().

◆ is_contained_in_selected_asset_library()

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

Definition at line 874 of file asset_ops.cc.

References BLI_path_contains(), lib, and selected_asset_library().

Referenced by asset_bundle_install_exec().

◆ 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)

Return an index that can be used to uniquely identify library, assuming that all relevant indices were created with this function.

Definition at line 29 of file asset_library_reference_enum.cc.

References ASSET_LIBRARY_CUSTOM, ASSET_LIBRARY_LOCAL, BKE_preferences_asset_library_find_index(), AssetLibraryReference::custom_library_index, AssetLibraryReference::type, and U.

Referenced by blender::ed::sculpt_paint::brush_asset_save_as_invoke(), blender::ed::animrig::pose_asset_create_invoke(), and rna_enum_add_custom_libraries().

◆ library_reference_to_rna_enum_itemf()

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

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.

Definition at line 101 of file asset_library_reference_enum.cc.

References ASSET_LIBRARY_ALL, ASSET_LIBRARY_ESSENTIALS, ASSET_LIBRARY_LOCAL, BLI_assert, BLI_listbase_is_empty(), rna_enum_add_custom_libraries(), rna_enum_asset_library_type_items, RNA_enum_item_add(), RNA_enum_item_add_separator(), RNA_enum_item_end(), and U.

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

◆ mark_id()

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

◆ operator_asset_reference_props_get_asset_from_all_library()

◆ operator_asset_reference_props_is_set()

bool blender::ed::asset::operator_asset_reference_props_is_set ( PointerRNA & ptr)

Definition at line 59 of file asset_menu_utils.cc.

References ptr, and RNA_struct_property_is_set().

Referenced by poselib_blend_init_get_action().

◆ 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

Definition at line 815 of file asset_ops.cc.

References custom_libraries_rna_enum_itemf().

Referenced by ASSET_OT_bundle_install().

◆ rna_enum_add_custom_libraries()

◆ screenshot_area_transfer_to_rna()

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

Definition at line 1291 of file asset_ops.cc.

References data, wmOperator::ptr, RNA_boolean_set(), and RNA_int_set_array().

Referenced by screenshot_preview_modal().

◆ screenshot_preview_draw()

void blender::ed::asset::screenshot_preview_draw ( const wmWindow * window,
void * operator_data )
static

◆ screenshot_preview_exec()

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

◆ screenshot_preview_exit()

void blender::ed::asset::screenshot_preview_exit ( bContext * C,
wmOperator * op )
static

◆ screenshot_preview_invoke()

◆ screenshot_preview_modal()

◆ screenshot_preview_poll()

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

◆ selected_asset_library()

◆ set_filepath_for_asset_lib()

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

Set the "filepath" RNA property based on selected "asset_library_reference".

Returns
true if ok, false if error.

Definition at line 887 of file asset_ops.cc.

References BLI_path_basename(), BLI_path_join, FILE_MAX, Main::filepath, lib, wmOperator::ptr, RNA_string_set(), and selected_asset_library().

Referenced by asset_bundle_install_invoke().

◆ sort_points()

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

Definition at line 995 of file asset_ops.cc.

Referenced by screenshot_preview_draw(), and screenshot_preview_exec().

◆ square_points_clamp_to_window()

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

Definition at line 1015 of file asset_ops.cc.

References WM_window_native_pixel_size().

Referenced by screenshot_preview_draw(), and screenshot_preview_exec().

◆ take_screenshot_crop()

ImBuf * blender::ed::asset::take_screenshot_crop ( bContext * C,
const rcti & crop_rect )
static

Takes a screenshot of Blender for the given rect. The returned ImBuf has to be freed by the caller with IMB_freeImBuf().

Definition at line 1092 of file asset_ops.cc.

References BLI_rcti_is_valid(), C, CTX_wm_window(), IB_TAKE_OWNERSHIP, IMB_allocImBuf(), IMB_assign_byte_buffer(), IMB_rect_crop(), max_ii(), MEM_freeN(), min_ii(), WM_window_pixels_read(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by screenshot_preview_exec().

◆ temp_id_consumer_create()

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

Definition at line 67 of file asset_temp_id_consumer.cc.

Referenced by poselib_blend_init_get_action().

◆ 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)

Definition at line 76 of file asset_temp_id_consumer.cc.

Referenced by poselib_tempload_exit().

◆ 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, U, and USER_EXPERIMENTAL_TEST.

Referenced by file_refresh().

◆ user_library_to_library_ref()

◆ visit_library_catalogs_catalog_for_search()

Variable Documentation

◆ DRAG_THRESHOLD

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

Definition at line 977 of file asset_ops.cc.

Referenced by screenshot_preview_modal().