|
Blender V4.3
|
#include <cstring>#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "BLI_fileops.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_preview_image.hh"#include "BKE_report.hh"#include "ED_asset.hh"#include "ED_render.hh"#include "ED_undo.hh"#include "ED_util.hh"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "UI_interface.hh"#include "WM_api.hh"#include "WM_types.hh"Go to the source code of this file.
Utility operators for UI data or for the UI to use.
Definition in file ed_util_ops.cc.
|
static |
Definition at line 382 of file ed_util_ops.cc.
References CTX_data_main(), ED_editors_flush_edits(), and OPERATOR_FINISHED.
Referenced by ED_OT_flush_edits().
| void ED_operatortypes_edutils | ( | ) |
Definition at line 405 of file ed_util_ops.cc.
References ED_OT_flush_edits(), ED_OT_lib_id_fake_user_toggle(), ED_OT_lib_id_generate_preview(), ED_OT_lib_id_generate_preview_from_object(), ED_OT_lib_id_load_custom_preview(), ED_OT_lib_id_override_editable_toggle(), ED_OT_lib_id_unlink(), ED_OT_redo(), ED_OT_undo(), ED_OT_undo_history(), ED_OT_undo_push(), ED_OT_undo_redo(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
|
static |
Definition at line 389 of file ed_util_ops.cc.
References wmOperatorType::description, ed_flush_edits_exec(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_INTERNAL, and ot.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 277 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lib_id_fake_user_toggle_exec(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 176 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lib_id_generate_preview_exec(), lib_id_generate_preview_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 221 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lib_id_generate_preview_from_object_exec(), lib_id_generate_preview_from_object_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 115 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, FILE_DEFAULTDISPLAY, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_SPECIAL, FILE_TYPE_FOLDER, FILE_TYPE_IMAGE, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, lib_id_load_custom_preview_exec(), lib_id_load_custom_preview_invoke(), lib_id_preview_editing_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, ot, wmOperatorType::poll, WM_FILESEL_FILEPATH, and WM_operator_properties_filesel().
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 361 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lib_id_override_editable_toggle_exec(), lib_id_override_editable_toggle_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 315 of file ed_util_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lib_id_unlink_exec(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_edutils().
|
static |
Definition at line 241 of file ed_util_ops.cc.
References BKE_id_is_editable(), BKE_report(), CTX_data_main(), PointerRNA::data, ELEM, GS, id_fake_user_clear(), id_fake_user_set(), ID_FAKE_USERS, ID_GR, ID_OB, ID_SCE, ID_SCR, ID_TXT, ID_WS, OPERATOR_CANCELLED, OPERATOR_FINISHED, PointerRNA_NULL, PropertyPointerRNA::prop, PropertyPointerRNA::ptr, wmOperator::reports, RNA_pointer_is_null(), RNA_property_pointer_get(), RNA_struct_is_ID(), RPT_ERROR, PointerRNA::type, and UI_context_active_but_prop_get_templateID().
Referenced by ED_OT_lib_id_fake_user_toggle().
|
static |
Definition at line 155 of file ed_util_ops.cc.
References BKE_previewimg_clear(), BKE_previewimg_id_get(), CTX_data_main(), CTX_data_pointer_get(), CTX_wm_manager(), PointerRNA::data, ED_preview_kill_jobs(), ICON_SIZE_PREVIEW, NA_EDITED, NC_ASSET, OPERATOR_FINISHED, UI_icon_render_id(), and WM_event_add_notifier().
Referenced by ED_OT_lib_id_generate_preview().
|
static |
Definition at line 201 of file ed_util_ops.cc.
References BKE_previewimg_id_ensure(), BKE_previewimg_id_free(), CTX_data_active_object(), CTX_data_main(), CTX_data_pointer_get(), CTX_wm_manager(), PointerRNA::data, ED_preview_kill_jobs(), ICON_SIZE_PREVIEW, Object::id, NA_EDITED, NC_ASSET, OPERATOR_FINISHED, UI_icon_render_id_ex(), and WM_event_add_notifier().
Referenced by ED_OT_lib_id_generate_preview_from_object().
|
static |
Definition at line 190 of file ed_util_ops.cc.
References CTX_data_active_object(), and lib_id_generate_preview_poll().
Referenced by ED_OT_lib_id_generate_preview_from_object().
|
static |
Definition at line 138 of file ed_util_ops.cc.
References CTX_data_pointer_get(), CTX_wm_operator_poll_msg_set(), PointerRNA::data, ED_preview_id_is_supported(), and lib_id_preview_editing_poll().
Referenced by ED_OT_lib_id_generate_preview(), and lib_id_generate_preview_from_object_poll().
|
static |
Definition at line 78 of file ed_util_ops.cc.
References BKE_previewimg_id_custom_set(), BKE_report(), BKE_reportf(), BLI_is_file(), FILE_MAX, lib_id_load_custom_preview_id_get(), NA_EDITED, NC_ASSET, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RPT_ERROR, and WM_event_add_notifier().
Referenced by ED_OT_lib_id_load_custom_preview().
|
static |
Definition at line 67 of file ed_util_ops.cc.
References CTX_data_pointer_get(), wmOperator::customdata, and PointerRNA::data.
Referenced by lib_id_load_custom_preview_exec(), and lib_id_load_custom_preview_invoke().
|
static |
Obtain the ID from context, and spawn a File Browser to select the preview image. The File Browser may re-use the Asset Browser under the cursor, and clear the file-list on confirmation, leading to failure to obtain the ID at that point. So get it before spawning the File Browser (store it in the operator custom data).
Definition at line 109 of file ed_util_ops.cc.
References wmOperator::customdata, lib_id_load_custom_preview_id_get(), and WM_operator_filesel().
Referenced by ED_OT_lib_id_load_custom_preview().
|
static |
Definition at line 337 of file ed_util_ops.cc.
References BKE_lib_override_library_id_reset(), BKE_lib_override_library_is_system_defined(), CTX_data_main(), CTX_data_pointer_get_type(), PointerRNA::data, NC_SPACE, NC_WINDOW, NC_WM, ND_LIB_OVERRIDE_CHANGED, ND_SPACE_VIEW3D, OPERATOR_FINISHED, WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by ED_OT_lib_id_override_editable_toggle().
|
static |
Definition at line 329 of file ed_util_ops.cc.
References CTX_data_pointer_get_type(), PointerRNA::data, ID_IS_LINKED, and ID_IS_OVERRIDE_LIBRARY_REAL.
Referenced by ED_OT_lib_id_override_editable_toggle().
|
static |
Definition at line 42 of file ed_util_ops.cc.
References BKE_previewimg_id_get_p(), BLI_assert, CTX_data_pointer_get(), CTX_wm_operator_poll_msg_set(), PointerRNA::data, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, RNA_struct_is_ID(), and PointerRNA::type.
Referenced by ED_OT_lib_id_load_custom_preview(), and lib_id_generate_preview_poll().
|
static |
Definition at line 291 of file ed_util_ops.cc.
References BKE_report(), OPERATOR_CANCELLED, OPERATOR_FINISHED, PropertyPointerRNA::prop, PropertyPointerRNA::ptr, wmOperator::reports, RNA_pointer_is_null(), RNA_property_pointer_get(), RNA_property_pointer_set(), RNA_property_update(), RNA_struct_is_ID(), RPT_ERROR, PointerRNA::type, and UI_context_active_but_prop_get_templateID().
Referenced by ED_OT_lib_id_unlink().