diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 11:38:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 11:49:18 +0300 |
commit | c17611af951e46fb82bf43d7449240f2f829b78f (patch) | |
tree | 51992764ea21b663b68c6aabb11fea843d115474 /source/blender/editors/space_view3d | |
parent | 64d40c82c324f7029e27ff59a4b1ca3200cddbef (diff) |
Manipulator: changes for overlay options
There are now 3 categories in the overlay popover:
- Navigation
- Active (camera, lamp... etc)
- Tool (manipulator)
The user preference for mini axis now controls if the mini axis
displays minimal or a full-interactive widget.
Part of design: T55863
Diffstat (limited to 'source/blender/editors/space_view3d')
9 files changed, 35 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 9aaced3e583..39315dcd64f 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -348,8 +348,6 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) v3d->near = 0.01f; v3d->far = 1000.0f; - v3d->twflag |= U.manipulator_flag & V3D_MANIPULATOR_DRAW; - v3d->bundle_size = 0.2f; v3d->bundle_drawtype = OB_PLAINAXES; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 2c732586606..62e9d4ee3bf 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1203,11 +1203,14 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar, const int UNUSED(of BLF_batch_draw_begin(); - if (((U.uiflag & USER_SHOW_ROTVIEWICON) != 0) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + if ((U.uiflag & USER_SHOW_MANIPULATOR_AXIS) || + (v3d->flag2 & V3D_RENDER_OVERRIDE) || /* No need to display manipulator and this info. */ - ((U.manipulator_flag & USER_MANIPULATOR_DRAW_NAVIGATE) == 0)) + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_NAVIGATE))) { + /* pass */ + } + else { draw_view_axis(rv3d, &rect); } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_armature.c b/source/blender/editors/space_view3d/view3d_manipulator_armature.c index abbd6c888b2..17dc4d8eb4a 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_armature.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_armature.c @@ -135,7 +135,12 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmManipulatorGro if (arm->drawtype == ARM_B_BONE) { if (arm->act_bone && arm->act_bone->segments > 1) { View3D *v3d = CTX_wm_view3d(C); - if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { + /* pass */ + } + else { return true; } } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_camera.c b/source/blender/editors/space_view3d/view3d_manipulator_camera.c index 023e16c070e..29f380c6334 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_camera.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_camera.c @@ -64,7 +64,9 @@ struct CameraWidgetGroup { static bool WIDGETGROUP_camera_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { return false; } @@ -358,7 +360,9 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmManipulatorGroupTy } View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { return false; } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_empty.c b/source/blender/editors/space_view3d/view3d_manipulator_empty.c index fc15ec593f5..16424c39bb8 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_empty.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_empty.c @@ -107,7 +107,10 @@ static void manipulator_empty_image_prop_matrix_set( static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { return false; } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_forcefield.c b/source/blender/editors/space_view3d/view3d_manipulator_forcefield.c index b42f49e6d1c..e4535004c8f 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_forcefield.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_forcefield.c @@ -55,7 +55,10 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { return false; } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c index 0e1015a66f1..39e908ec99d 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c @@ -55,7 +55,9 @@ static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT))) + { return false; } diff --git a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c index 9eb3ca89c55..465faf70fcd 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c @@ -179,14 +179,13 @@ struct NavigateWidgetGroup { static bool WIDGETGROUP_navigate_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_RENDER_OVERRIDE) { + if (((U.uiflag & USER_SHOW_MANIPULATOR_AXIS) == 0) || + (v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_NAVIGATE))) + { return false; } - - if (U.manipulator_flag & USER_MANIPULATOR_DRAW_NAVIGATE) { - return true; - } - return false; + return true; } diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 18b63151c8e..fb9cf917701 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -541,7 +541,7 @@ void view3d_keymap(wmKeyConfig *keyconf) #else kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0); #endif - RNA_string_set(kmi->ptr, "data_path", "space_data.show_manipulator"); + RNA_string_set(kmi->ptr, "data_path", "space_data.show_manipulator_tool"); transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D); |