Blender  V3.3
Functions
asset_mark_clear.cc File Reference
#include "DNA_ID.h"
#include "BKE_asset.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "UI_interface_icons.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "ED_asset_list.h"
#include "ED_asset_mark_clear.h"
#include "ED_asset_type.h"

Go to the source code of this file.

Functions

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

Detailed Description

Functions for marking and clearing assets.

Definition in file asset_mark_clear.cc.

Function Documentation

◆ ED_asset_can_mark_single_from_context()

bool ED_asset_can_mark_single_from_context ( const 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 bContext C,
ID id 
)

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