Blender  V3.3
Functions
ED_asset_mark_clear.h File Reference

Go to the source code of this file.

Functions

bool ED_asset_mark_id (struct ID *id)
 
void ED_asset_generate_preview (const struct bContext *C, struct ID *id)
 
bool ED_asset_clear_id (struct ID *id)
 
void ED_assets_pre_save (struct Main *bmain)
 
bool ED_asset_can_mark_single_from_context (const struct bContext *C)
 

Function Documentation

◆ ED_asset_can_mark_single_from_context()

bool ED_asset_can_mark_single_from_context ( const struct bContext C)

◆ ED_asset_clear_id()

bool ED_asset_clear_id ( struct ID id)

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

This clears the Fake User. If for some reason the datablock 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 59 of file asset_mark_clear.cc.

References ID::asset_data, BKE_asset_metadata_free(), ED_assetlist_storage_tag_main_data_dirty(), id, and id_fake_user_clear().

Referenced by AssetClearHelper::operator()().

◆ ED_asset_generate_preview()

void ED_asset_generate_preview ( const struct bContext C,
struct ID id 
)

Generate preview image for the given datablock.

The preview image might be generated using a background thread.

Referenced by AssetMarkHelper::operator()().

◆ ED_asset_mark_id()

bool ED_asset_mark_id ( struct ID id)

Mark the datablock as asset.

To ensure the datablock is saved, this sets Fake User.

Returns
whether the datablock was marked as asset; false when it is not capable of becoming an asset, or when it already was an asset.

Definition at line 28 of file asset_mark_clear.cc.

References ID::asset_data, IDTypeInfo::asset_type_info, BKE_asset_metadata_create(), BKE_id_can_be_asset(), BKE_idtype_get_info_from_id(), ED_assetlist_storage_tag_main_data_dirty(), id, and id_fake_user_set().

Referenced by AssetMarkHelper::operator()().

◆ ED_assets_pre_save()

void ED_assets_pre_save ( struct Main bmain)