|
Blender V4.3
|
#include <AS_asset_representation.hh>
Inherits blender::NonCopyable, and blender::NonMovable.
Public Member Functions | |
| AssetRepresentation (StringRef relative_asset_path, StringRef name, int id_type, std::unique_ptr< AssetMetaData > metadata, const AssetLibrary &owner_asset_library) | |
| AssetRepresentation (StringRef relative_asset_path, ID &id, const AssetLibrary &owner_asset_library) | |
| ~AssetRepresentation ()=default | |
| AssetWeakReference | make_weak_reference () const |
| StringRefNull | get_name () const |
| ID_Type | get_id_type () const |
| AssetMetaData & | get_metadata () const |
| StringRefNull | library_relative_identifier () const |
| std::string | full_path () const |
| std::string | full_library_path () const |
| std::optional< eAssetImportMethod > | get_import_method () const |
| bool | may_override_import_method () const |
| bool | get_use_relative_path () const |
| ID * | local_id () const |
| bool | is_local_id () const |
| const AssetLibrary & | owner_asset_library () const |
Friends | |
| class | AssetLibrary |
Definition at line 34 of file AS_asset_representation.hh.
| blender::asset_system::AssetRepresentation::AssetRepresentation | ( | StringRef | relative_asset_path, |
| StringRef | name, | ||
| int | id_type, | ||
| std::unique_ptr< AssetMetaData > | metadata, | ||
| const AssetLibrary & | owner_asset_library ) |
Constructs an asset representation for an external ID. The asset will not be editable.
Definition at line 23 of file asset_representation.cc.
| blender::asset_system::AssetRepresentation::AssetRepresentation | ( | StringRef | relative_asset_path, |
| ID & | id, | ||
| const AssetLibrary & | owner_asset_library ) |
Constructs an asset representation for an ID stored in the current file. This makes the asset local and fully editable.
Definition at line 34 of file asset_representation.cc.
|
default |
| std::string blender::asset_system::AssetRepresentation::full_library_path | ( | ) | const |
Definition at line 90 of file asset_representation.cc.
References BKE_blendfile_library_path_explode(), and full_path().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), blender::ed::asset::AssetTemporaryIDConsumer::import_id(), and WM_drag_asset_id_import().
| std::string blender::asset_system::AssetRepresentation::full_path | ( | ) | const |
Definition at line 80 of file asset_representation.cc.
References BLI_path_join, blender::StringRefNull::c_str(), FILE_MAX, and blender::asset_system::AssetLibrary::root_path().
Referenced by blender::ed::asset::find_asset_from_weak_ref(), and full_library_path().
| ID_Type blender::asset_system::AssetRepresentation::get_id_type | ( | ) | const |
Definition at line 59 of file asset_representation.cc.
References GS, and local_id().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), blender::ed::asset::filter_matches_asset(), view3d_drop_id_in_main_region_poll_get_id_type(), WM_drag_asset_id_import(), WM_drag_free_imported_drag_ID(), and WM_drag_get_asset_data().
| std::optional< eAssetImportMethod > blender::asset_system::AssetRepresentation::get_import_method | ( | ) | const |
Get the import method to use for this asset. A different one may be used if may_override_import_method() returns true, otherwise, the returned value must be used. If there is no import method predefined for this asset no value is returned.
Definition at line 102 of file asset_representation.cc.
References blender::asset_system::AssetLibrary::import_method_.
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), asset_view_item_but_drag_set(), and blender::ed::asset::shelf::AssetDragController::create_drag_data().
| AssetMetaData & blender::asset_system::AssetRepresentation::get_metadata | ( | ) | const |
Definition at line 67 of file asset_representation.cc.
References local_id().
Referenced by blender::ed::asset::asset_tooltip(), blender::ed::sculpt_paint::brush_asset_edit_metadata_invoke(), blender::ed::sculpt_paint::brush_asset_save_as_invoke(), blender::ed::asset::build_filtered_all_catalog_tree(), blender::ed::asset::build_filtered_catalog_tree(), compare_asset_catalog(), blender::ed::asset::filter_matches_asset(), blender::ed::object::modifier_add_asset_get_description(), blender::ed::space_node::node_add_group_asset_get_description(), blender::ed::space_node::node_group_drop_poll(), blender::ed::geometry::run_node_group_depends_on_cursor(), blender::ed::geometry::run_node_group_get_description(), blender::ed::space_node::search_link_ops_for_asset_metadata(), view3d_geometry_nodes_drop_poll(), and WM_drag_get_asset_meta_data().
| StringRefNull blender::asset_system::AssetRepresentation::get_name | ( | ) | const |
Definition at line 51 of file asset_representation.cc.
References local_id().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), blender::ed::asset::asset_tooltip(), asset_view_filter_items(), blender::ed::sculpt_paint::brush_asset_save_as_invoke(), blender::ed::asset::shelf::AssetView::build_items(), blender::ed::asset::AssetTemporaryIDConsumer::import_id(), blender::ed::space_node::search_link_ops_for_asset_metadata(), blender::ed::asset::shelf::AssetViewItem::should_be_filtered_visible(), WM_drag_asset_id_import(), and WM_drag_get_item_name().
| bool blender::asset_system::AssetRepresentation::get_use_relative_path | ( | ) | const |
Definition at line 115 of file asset_representation.cc.
References blender::asset_system::AssetLibrary::use_relative_path_.
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), and WM_drag_asset_id_import().
| bool blender::asset_system::AssetRepresentation::is_local_id | ( | ) | const |
Returns if this asset is stored inside this current file, and as such fully editable.
Definition at line 125 of file asset_representation.cc.
Referenced by blender::ed::asset::shelf::AssetDragController::get_drag_type(), local_id(), blender::asset_system::AssetLibrary::remap_ids_and_remove_invalid(), and blender::ed::asset::AssetClearHelper::reportResults().
| StringRefNull blender::asset_system::AssetRepresentation::library_relative_identifier | ( | ) | const |
Definition at line 75 of file asset_representation.cc.
Referenced by blender::ed::asset::shelf::AssetView::build_items(), and blender::ed::asset::get_local_asset_from_relative_identifier().
| ID * blender::asset_system::AssetRepresentation::local_id | ( | ) | const |
If this asset is stored inside this current file (is_local_id() is true), this returns the ID's pointer, otherwise null.
Definition at line 120 of file asset_representation.cc.
References is_local_id().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), asset_view_item_but_drag_set(), blender::ed::asset::shelf::AssetDragController::create_drag_data(), get_id_type(), blender::ed::asset::AssetTemporaryIDConsumer::get_local_id(), get_metadata(), get_name(), and WM_drag_add_asset_list_item().
| AssetWeakReference blender::asset_system::AssetRepresentation::make_weak_reference | ( | ) | const |
Create a weak reference for this asset that can be written to files, but can break under a number of conditions. A weak reference can only be created if an asset representation is owned by an asset library.
Definition at line 46 of file asset_representation.cc.
Referenced by blender::ed::sculpt_paint::brush_asset_activate_exec(), blender::ed::asset::operator_asset_reference_props_set(), blender::ed::asset::shelf::AssetViewItem::should_be_active(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().
| bool blender::asset_system::AssetRepresentation::may_override_import_method | ( | ) | const |
Returns if this asset may be imported with an import method other than the one returned by get_import_method(). Also returns true if there is no predefined import method (when get_import_method() returns no value).
Definition at line 107 of file asset_representation.cc.
References blender::asset_system::AssetLibrary::import_method_, and blender::asset_system::AssetLibrary::may_override_import_method_.
| const AssetLibrary & blender::asset_system::AssetRepresentation::owner_asset_library | ( | ) | const |
Definition at line 130 of file asset_representation.cc.
Referenced by blender::ed::sculpt_paint::brush_asset_edit_metadata_exec(), blender::ed::sculpt_paint::brush_asset_edit_metadata_invoke(), blender::ed::sculpt_paint::brush_asset_edit_metadata_poll(), blender::ed::sculpt_paint::brush_asset_load_preview_exec(), blender::ed::sculpt_paint::brush_asset_save_as_invoke(), compare_asset_catalog(), and blender::ed::sculpt_paint::visit_active_library_catalogs_catalog_for_search_fn().
|
friend |
Definition at line 50 of file AS_asset_representation.hh.