Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/asset/intern/asset_mark_clear.cc
| Show All 33 Lines | |||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "UI_interface_icons.h" | #include "UI_interface_icons.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "ED_asset_list.h" | #include "ED_asset_list.h" | ||||
| #include "ED_asset_mark_clear.h" | #include "ED_asset_mark_clear.h" | ||||
| #include "ED_asset_type.h" | |||||
| bool ED_asset_mark_id(ID *id) | bool ED_asset_mark_id(ID *id) | ||||
| { | { | ||||
| if (id->asset_data) { | if (id->asset_data) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (!BKE_id_can_be_asset(id)) { | if (!BKE_id_can_be_asset(id)) { | ||||
| return false; | return false; | ||||
| Show All 26 Lines | bool ED_asset_clear_id(ID *id) | ||||
| ED_assetlist_storage_tag_main_data_dirty(); | ED_assetlist_storage_tag_main_data_dirty(); | ||||
| return true; | return true; | ||||
| } | } | ||||
| bool ED_asset_can_mark_single_from_context(const bContext *C) | bool ED_asset_can_mark_single_from_context(const bContext *C) | ||||
| { | { | ||||
| /* Context needs a "id" pointer to be set for #ASSET_OT_mark()/#ASSET_OT_clear() to use. */ | /* Context needs a "id" pointer to be set for #ASSET_OT_mark()/#ASSET_OT_clear() to use. */ | ||||
| return CTX_data_pointer_get_type_silent(C, "id", &RNA_ID).data != nullptr; | const ID *id = static_cast<ID *>(CTX_data_pointer_get_type_silent(C, "id", &RNA_ID).data); | ||||
| if (!id) { | |||||
| return false; | |||||
| } | |||||
| return ED_asset_type_is_supported(id); | |||||
| } | } | ||||