74 return "OBJECT_OT_editmode_toggle";
77 return "SCULPT_OT_sculptmode_toggle";
80 return "PAINT_OT_vertex_paint_toggle";
83 return "PAINT_OT_weight_paint_toggle";
86 return "PAINT_OT_texture_paint_toggle";
89 return "PARTICLE_OT_particle_edit_toggle";
92 return "OBJECT_OT_posemode_toggle";
95 return "GPENCIL_OT_editmode_toggle";
98 return "GPENCIL_OT_paintmode_toggle";
101 return "GPENCIL_OT_sculptmode_toggle";
104 return "GPENCIL_OT_weightmode_toggle";
107 return "GPENCIL_OT_vertexmode_toggle";
208 if (ob->
mode == mode) {
227 if (ob->
mode != mode) {
332 const bool is_mode_set)
337 if (ob_arm !=
NULL) {
364 const bool is_mode_set)
369 &virtualModifierData);
370 for (; md; md = md->
next) {
381 for (; md; md = md->
next) {
443 if (base_dst ==
NULL) {
450 if (ob_dst == ob_src) {
459 bool mode_transfered =
false;
477 mode_transfered =
true;
481 return mode_transfered;
486 switch (event->
type) {
503 if (!mode_transfered) {
522 if (use_eyedropper) {
534 if (!mode_transfered) {
548 ot->
name =
"Transfer Mode";
549 ot->
idname =
"OBJECT_OT_transfer_mode";
551 "Switches the active object and assigns the same mode to a new one under the mouse cursor, "
552 "leaving the active mode in the current one";
566 "Pick the object to switch to using an eyedropper");
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct GpencilModifierData * BKE_gpencil_modifiers_get_virtual_modifierlist(const struct Object *ob, struct GpencilVirtualModifierData *data)
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, struct Base *selbase)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
bool BKE_object_is_in_editmode(const struct Object *ob)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
struct ARegion * BKE_screen_find_main_region_at_xy(struct bScreen *screen, const int space_type, const int x, const int y)
MINLINE void copy_v3_v3(float r[3], const float a[3])
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_original_object(struct Object *object)
@ eGpencilModifierType_Armature
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_MODE_DATA
Object is a sort of wrapper for general info.
#define OBACT(_view_layer)
#define BASE_VISIBLE(v3d, base)
void ED_object_vpaintmode_exit_ex(struct Object *ob)
void ED_object_wpaintmode_exit_ex(struct Object *ob)
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
void ED_object_texture_paint_mode_exit_ex(struct Main *bmain, struct Scene *scene, Object *ob)
void ED_object_particle_edit_mode_exit_ex(struct Scene *scene, Object *ob)
void ED_object_sculptmode_exit_ex(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
void ED_workspace_status_text(struct bContext *C, const char *str)
void ED_undo_group_begin(struct bContext *C)
void ED_undo_push(struct bContext *C, const char *str)
void ED_undo_group_end(struct bContext *C)
struct Base * ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2])
bool ED_view3d_autodist_simple(struct ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
const Depsgraph * depsgraph
bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
void ED_object_posemode_set_for_weight_paint(bContext *C, Main *bmain, Object *ob, const bool is_mode_set)
bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
bool ED_object_mode_compat_set(bContext *C, Object *ob, eObjectMode mode, ReportList *reports)
static bool object_transfer_mode_poll(bContext *C)
static bool ed_object_mode_generic_exit_ex(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, bool only_test)
static int object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_object_mode_generic_exit(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
static bool object_transfer_mode_to_base(bContext *C, wmOperator *op, Base *base_dst)
static int object_transfer_mode_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void ed_object_posemode_set_for_weight_paint_ex(bContext *C, Main *bmain, Object *ob_arm, const bool is_mode_set)
static void object_transfer_mode_reposition_view_pivot(bContext *C, const int mval[2])
void OBJECT_OT_transfer_mode(wmOperatorType *ot)
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob)
static const char * object_mode_op_string(eObjectMode mode)
bool ED_object_mode_set(bContext *C, eObjectMode mode)
bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportList *reports)
bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
bool ED_object_posemode_exit_ex(struct Main *bmain, Object *ob)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
struct GpencilModifierData * next
struct ModifierData * next
struct SculptSession * sculpt
struct ToolSettings * toolsettings
float average_stroke_accum[3]
int average_stroke_counter
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)