32 #include "RNA_prototypes.h"
91 ot->
name =
"Load Custom Preview";
92 ot->
description =
"Choose an image to help identify the data-block visually";
93 ot->
idname =
"ED_OT_lib_id_load_custom_preview";
150 ot->
name =
"Generate Preview";
151 ot->
description =
"Create an automatic preview for the selected data-block";
152 ot->
idname =
"ED_OT_lib_id_generate_preview";
194 ot->
name =
"Generate Preview from Object";
195 ot->
description =
"Create a preview for this asset by rendering the active object";
196 ot->
idname =
"ED_OT_lib_id_generate_preview_from_object";
225 op->
reports,
RPT_ERROR,
"Incorrect context for running data-block fake user toggling");
250 ot->
name =
"Toggle Fake User";
251 ot->
description =
"Save this data-block even if it has no users";
252 ot->
idname =
"ED_OT_lib_id_fake_user_toggle";
274 op->
reports,
RPT_ERROR,
"Incorrect context for running data-block fake user toggling");
278 memset(&idptr, 0,
sizeof(idptr));
288 ot->
name =
"Unlink Data-Block";
289 ot->
description =
"Remove a usage of a data-block, clearing the assignment";
302 const ID *
id =
static_cast<ID *
>(id_ptr.
data);
311 ID *
id =
static_cast<ID *
>(id_ptr.
data);
314 if (is_system_override) {
331 ot->
name =
"Toggle Library Override Editable";
332 ot->
description =
"Set if this library override data-block can be edited";
333 ot->
idname =
"ED_OT_lib_id_override_editable_toggle";
360 ot->
description =
"Flush edit data from active editing modes";
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
struct Object * CTX_data_active_object(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct PreviewImage * BKE_previewimg_id_ensure(struct ID *id)
void BKE_previewimg_id_free(struct ID *id)
void BKE_previewimg_clear(struct PreviewImage *prv)
struct PreviewImage ** BKE_previewimg_id_get_p(const struct ID *id)
struct PreviewImage * BKE_previewimg_id_get(const struct ID *id)
void BKE_previewimg_id_custom_set(struct ID *id, const char *filepath)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void id_fake_user_set(struct ID *id)
void id_fake_user_clear(struct ID *id)
void BKE_lib_override_library_id_reset(struct Main *bmain, struct ID *id_root, bool do_reset_system_override)
bool BKE_lib_override_library_is_system_defined(const struct Main *bmain, const struct ID *id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
File and directory operations.
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define ID_FAKE_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED
void ED_assetlist_storage_tag_main_data_dirty(void)
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain)
void ED_OT_undo_history(struct wmOperatorType *ot)
void ED_OT_undo(struct wmOperatorType *ot)
void ED_OT_undo_redo(struct wmOperatorType *ot)
void ED_OT_redo(struct wmOperatorType *ot)
void ED_OT_undo_push(struct wmOperatorType *ot)
bool ED_editors_flush_edits(struct Main *bmain)
void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop)
void UI_icon_render_id_ex(const struct bContext *C, struct Scene *scene, struct ID *id_to_render, const enum eIconSizes size, const bool use_job, struct PreviewImage *r_preview_image)
void UI_icon_render_id(const struct bContext *C, struct Scene *scene, struct ID *id, enum eIconSizes size, bool use_job)
#define ND_LIB_OVERRIDE_CHANGED
static bool lib_id_generate_preview_poll(bContext *C)
static int lib_id_generate_preview_from_object_exec(bContext *C, wmOperator *UNUSED(op))
static int lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op)
void ED_operatortypes_edutils()
static int lib_id_override_editable_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static void ED_OT_lib_id_generate_preview(wmOperatorType *ot)
static void ED_OT_lib_id_unlink(wmOperatorType *ot)
static int ed_flush_edits_exec(bContext *C, wmOperator *UNUSED(op))
static int lib_id_load_custom_preview_exec(bContext *C, wmOperator *op)
static void ED_OT_lib_id_generate_preview_from_object(wmOperatorType *ot)
static void ED_OT_flush_edits(wmOperatorType *ot)
static int lib_id_generate_preview_exec(bContext *C, wmOperator *UNUSED(op))
static bool lib_id_generate_preview_from_object_poll(bContext *C)
static void ED_OT_lib_id_override_editable_toggle(wmOperatorType *ot)
static bool lib_id_override_editable_toggle_poll(bContext *C)
static bool lib_id_preview_editing_poll(bContext *C)
static void ED_OT_lib_id_load_custom_preview(wmOperatorType *ot)
static void ED_OT_lib_id_fake_user_toggle(wmOperatorType *ot)
static int lib_id_unlink_exec(bContext *C, wmOperator *op)
static const pxr::TfToken preview("preview", pxr::TfToken::Immortal)
bool RNA_struct_is_ID(const StructRNA *type)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
const PointerRNA PointerRNA_NULL
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_pointer_is_null(const PointerRNA *ptr)
struct PropertyRNA * prop
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
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_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))