Object Mode: add back non '_ex' versions of mode-switching functions
While these aren't currently used, its strange to have extended versions of a function without the non-extended versions it also avoids callers needing to add them back if they need - or duplicating the same boiler plate when calling the '_ex' versions. Reverts11da3b132a,11da3b132a, adds depsgraph argument so the caller is responsible for the evaluation state.
This commit is contained in:
@@ -166,11 +166,13 @@ void ED_object_vpaintmode_enter_ex(struct Main *bmain,
|
||||
struct wmWindowManager *wm,
|
||||
struct Scene *scene,
|
||||
struct Object *ob);
|
||||
void ED_object_vpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
|
||||
void ED_object_wpaintmode_enter_ex(struct Main *bmain,
|
||||
struct Depsgraph *depsgraph,
|
||||
struct wmWindowManager *wm,
|
||||
struct Scene *scene,
|
||||
struct Object *ob);
|
||||
void ED_object_wpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
|
||||
|
||||
void ED_object_vpaintmode_exit_ex(struct Object *ob);
|
||||
void ED_object_vpaintmode_exit(struct bContext *C);
|
||||
@@ -183,10 +185,14 @@ void ED_object_sculptmode_enter_ex(struct Main *bmain,
|
||||
struct Object *ob,
|
||||
const bool force_dyntopo,
|
||||
struct ReportList *reports);
|
||||
void ED_object_sculptmode_enter(struct bContext *C,
|
||||
struct Depsgraph *depsgraph,
|
||||
struct ReportList *reports);
|
||||
void ED_object_sculptmode_exit_ex(struct Main *bmain,
|
||||
struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
struct Object *ob);
|
||||
void ED_object_sculptmode_exit(struct bContext *C, struct Depsgraph *depsgraph);
|
||||
|
||||
void ED_object_location_from_view(struct bContext *C, float loc[3]);
|
||||
void ED_object_rotation_from_quat(float rot[3], const float quat[4], const char align_axis);
|
||||
@@ -267,6 +273,7 @@ bool ED_object_mode_compat_set(struct bContext *C,
|
||||
struct ReportList *reports);
|
||||
void ED_object_mode_toggle(struct bContext *C, eObjectMode mode);
|
||||
void ED_object_mode_set(struct bContext *C, eObjectMode mode);
|
||||
void ED_object_mode_exit(struct bContext *C, struct Depsgraph *depsgraph);
|
||||
|
||||
bool ED_object_mode_generic_enter(struct bContext *C, eObjectMode object_mode);
|
||||
void ED_object_mode_generic_exit(struct Main *bmain,
|
||||
|
||||
@@ -186,6 +186,19 @@ void ED_object_mode_set(bContext *C, eObjectMode mode)
|
||||
wm->op_undo_depth--;
|
||||
}
|
||||
|
||||
void ED_object_mode_exit(bContext *C, Depsgraph *depsgraph)
|
||||
{
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
FOREACH_OBJECT_BEGIN (view_layer, ob) {
|
||||
if (ob->mode & OB_MODE_ALL_MODE_DATA) {
|
||||
ED_object_mode_generic_exit(bmain, depsgraph, scene, ob);
|
||||
}
|
||||
}
|
||||
FOREACH_OBJECT_END;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -1171,11 +1171,28 @@ void ED_object_vpaintmode_enter_ex(
|
||||
{
|
||||
ed_vwpaintmode_enter_generic(bmain, depsgraph, wm, scene, ob, OB_MODE_VERTEX_PAINT);
|
||||
}
|
||||
void ED_object_vpaintmode_enter(struct bContext *C, Depsgraph *depsgraph)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
|
||||
}
|
||||
|
||||
void ED_object_wpaintmode_enter_ex(
|
||||
Main *bmain, Depsgraph *depsgraph, wmWindowManager *wm, Scene *scene, Object *ob)
|
||||
{
|
||||
ed_vwpaintmode_enter_generic(bmain, depsgraph, wm, scene, ob, OB_MODE_WEIGHT_PAINT);
|
||||
}
|
||||
void ED_object_wpaintmode_enter(struct bContext *C, Depsgraph *depsgraph)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
|
||||
@@ -6152,6 +6152,15 @@ void ED_object_sculptmode_enter_ex(Main *bmain,
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
void ED_object_sculptmode_enter(struct bContext *C, Depsgraph *depsgraph, ReportList *reports)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
Object *ob = OBACT(view_layer);
|
||||
ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, false, reports);
|
||||
}
|
||||
|
||||
void ED_object_sculptmode_exit_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
|
||||
{
|
||||
const int mode_flag = OB_MODE_SCULPT;
|
||||
@@ -6198,6 +6207,15 @@ void ED_object_sculptmode_exit_ex(Main *bmain, Depsgraph *depsgraph, Scene *scen
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
void ED_object_sculptmode_exit(bContext *C, Depsgraph *depsgraph)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
Object *ob = OBACT(view_layer);
|
||||
ED_object_sculptmode_exit_ex(bmain, depsgraph, scene, ob);
|
||||
}
|
||||
|
||||
static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
struct wmMsgBus *mbus = CTX_wm_message_bus(C);
|
||||
|
||||
Reference in New Issue
Block a user