diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 10:20:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 10:21:19 +0300 |
commit | 65e3af35b0c8dc00bd1fe0c51590e6f768f602b4 (patch) | |
tree | 4273076bcd2264599e24bb55127a266376490e20 /source/blender | |
parent | b6263608576f48b52b7b588f16455028ba9b3db0 (diff) |
Extrude Widget: subscribe to operator settings
Needed so changing orientation refreshes.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index c8b2850cbad..75d822a33ab 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -47,6 +47,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_message.h" #include "ED_mesh.h" #include "ED_screen.h" @@ -494,6 +495,27 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro } } +static void manipulator_mesh_extrude_message_subscribe( + const bContext *C, wmManipulatorGroup *mgroup, struct wmMsgBus *mbus) +{ + ManipulatorExtrudeGroup *man = mgroup->customdata; + ARegion *ar = CTX_wm_region(C); + + /* Subscribe to view properties */ + wmMsgSubscribeValue msg_sub_value_mpr_tag_refresh = { + .owner = ar, + .user_data = mgroup->parent_mmap, + .notify = WM_manipulator_do_msg_notify_tag_refresh, + }; + + { + PointerRNA ot_ptr; + WM_operator_last_properties_ensure(man->ot_extrude, &ot_ptr); + PointerRNA macroptr = RNA_pointer_get(&ot_ptr, "TRANSFORM_OT_translate"); + WM_msg_subscribe_rna(mbus, ¯optr, NULL, &msg_sub_value_mpr_tag_refresh, __func__); + } +} + static void MESH_WGT_extrude(struct wmManipulatorGroupType *wgt) { wgt->name = "Mesh Extrude"; @@ -507,6 +529,7 @@ static void MESH_WGT_extrude(struct wmManipulatorGroupType *wgt) wgt->poll = manipulator_mesh_extrude_poll; wgt->setup = manipulator_mesh_extrude_setup; wgt->refresh = manipulator_mesh_extrude_refresh; + wgt->message_subscribe = manipulator_mesh_extrude_message_subscribe; } #endif /* USE_MANIPULATOR */ |