31#include "RNA_prototypes.hh"
75 return static_cast<ID *
>(idptr.
data);
92 op->
reports,
RPT_ERROR,
"Failed to set preview: no ID in context (incorrect context?)");
117 ot->
name =
"Load Custom Preview";
118 ot->
description =
"Choose an image to help identify the data-block visually";
119 ot->
idname =
"ED_OT_lib_id_load_custom_preview";
146 const char *disabled_hint =
nullptr;
171 asset::list::storage_tag_main_data_dirty();
178 ot->
name =
"Generate Preview";
179 ot->
description =
"Create an automatic preview for the selected data-block";
180 ot->
idname =
"ED_OT_lib_id_generate_preview";
216 asset::list::storage_tag_main_data_dirty();
223 ot->
name =
"Generate Preview from Object";
224 ot->
description =
"Create a preview for this asset by rendering the active object";
225 ot->
idname =
"ED_OT_lib_id_generate_preview_from_object";
254 op->
reports,
RPT_ERROR,
"Incorrect context for running data-block fake user toggling");
280 ot->
name =
"Toggle Fake User";
281 ot->
description =
"Save this data-block even if it has no users";
282 ot->
idname =
"ED_OT_lib_id_fake_user_toggle";
304 op->
reports,
RPT_ERROR,
"Incorrect context for running data-block fake user toggling");
318 ot->
name =
"Unlink Data-Block";
319 ot->
description =
"Remove a usage of a data-block, clearing the assignment";
332 const ID *
id =
static_cast<ID *
>(id_ptr.
data);
341 ID *
id =
static_cast<ID *
>(id_ptr.
data);
344 if (is_system_override) {
346 id->override_library->flag &= ~LIBOVERRIDE_FLAG_SYSTEM_DEFINED;
364 ot->
name =
"Toggle Library Override Editable";
365 ot->
description =
"Set if this library override data-block can be edited";
366 ot->
idname =
"ED_OT_lib_id_override_editable_toggle";
393 ot->
description =
"Flush edit data from active editing modes";
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Object * CTX_data_active_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
void id_fake_user_set(ID *id)
void id_fake_user_clear(ID *id)
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
void BKE_lib_override_library_id_reset(Main *bmain, ID *id_root, bool do_reset_system_override)
PreviewImage * BKE_previewimg_id_get(const ID *id)
PreviewImage * BKE_previewimg_id_ensure(ID *id)
PreviewImage ** BKE_previewimg_id_get_p(const ID *id)
void BKE_previewimg_id_custom_set(ID *id, const char *filepath)
void BKE_previewimg_clear(PreviewImage *prv)
void BKE_previewimg_id_free(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_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
bool ED_preview_id_is_supported(const ID *id, const char **r_disabled_hint=nullptr)
void ED_preview_kill_jobs(wmWindowManager *wm, Main *bmain)
void ED_OT_redo(wmOperatorType *ot)
void ED_OT_undo_redo(wmOperatorType *ot)
void ED_OT_undo_push(wmOperatorType *ot)
void ED_OT_undo(wmOperatorType *ot)
void ED_OT_undo_history(wmOperatorType *ot)
bool ED_editors_flush_edits(Main *bmain)
constexpr PointerRNA PointerRNA_NULL
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
void UI_icon_render_id(const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
void UI_icon_render_id_ex(const bContext *C, Scene *scene, ID *id_to_render, const enum eIconSizes size, const bool use_job, PreviewImage *r_preview_image)
#define ND_LIB_OVERRIDE_CHANGED
static bool lib_id_generate_preview_poll(bContext *C)
static int lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op)
void ED_operatortypes_edutils()
static void ED_OT_lib_id_generate_preview(wmOperatorType *ot)
static int lib_id_load_custom_preview_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int lib_id_generate_preview_from_object_exec(bContext *C, wmOperator *)
static void ED_OT_lib_id_unlink(wmOperatorType *ot)
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 int ed_flush_edits_exec(bContext *C, wmOperator *)
static void ED_OT_flush_edits(wmOperatorType *ot)
static ID * lib_id_load_custom_preview_id_get(bContext *C, const wmOperator *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_generate_preview_exec(bContext *C, wmOperator *)
static int lib_id_override_editable_toggle_exec(bContext *C, wmOperator *)
static int lib_id_unlink_exec(bContext *C, wmOperator *op)
bool RNA_struct_is_ID(const StructRNA *type)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
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)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(uint 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 *)