39 return U.experimental.use_asset_browser;
79 int tot_already_asset = 0;
80 ID *last_id =
nullptr;
93 stats.tot_already_asset++;
106 return stats.tot_created > 0;
113 if ((stats.tot_already_asset > 0)) {
116 "Selected data-blocks are already assets (or do not support use as assets)");
121 "No data-blocks to create assets for found (or do not support use as assets)");
125 else if (stats.tot_created == 1) {
127 BKE_reportf(&reports,
RPT_INFO,
"Data-block '%s' is now an asset", stats.last_id->name + 2);
139 mark_helper(*
C, ids);
156 "Enable easier reuse of selected data-blocks through the Asset Browser, with the help of "
157 "customizable metadata (like previews, descriptions and tags)";
178 ID *last_id =
nullptr;
206 else if (stats.tot_cleared == 1) {
209 &reports,
RPT_INFO,
"Data-block '%s' is no asset anymore", stats.last_id->name + 2);
212 BKE_reportf(&reports,
RPT_INFO,
"%i data-blocks are no assets anymore", stats.tot_cleared);
218 return stats.tot_cleared > 0;
243 "Delete all asset metadata and turn the selected asset data-blocks back into normal "
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
int CTX_data_selected_ids(const bContext *C, ListBase *list)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
bool ED_asset_clear_id(ID *id)
bool ED_asset_mark_id(const bContext *C, ID *id)
static void ASSET_OT_mark(wmOperatorType *ot)
static int asset_clear_exec(bContext *C, wmOperator *op)
static PointerRNAVec asset_operation_get_ids_from_context(const bContext *C)
static int asset_mark_exec(bContext *C, wmOperator *op)
static void ASSET_OT_clear(wmOperatorType *ot)
static bool asset_operation_poll(bContext *)
void ED_operatortypes_asset(void)
bool wasSuccessful() const
void operator()(PointerRNAVec &ids)
void reportResults(ReportList &reports) const
bool wasSuccessful() const
void operator()(const bContext &C, PointerRNAVec &ids)
void reportResults(ReportList &reports) const
void append(const T &value)
bool RNA_struct_is_ID(const StructRNA *type)
struct AssetMetaData * asset_data
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))