diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
4 files changed, 31 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.c b/source/blender/editors/space_view3d/view3d_gizmo_camera.c index 8f0a57375fd..590597145a0 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_camera.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.c @@ -64,6 +64,11 @@ static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED( if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { return false; } + if ((v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_LENS) == 0 && + (v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_DOF_DIST) == 0) + { + return false; + } ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); @@ -133,6 +138,7 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup) } struct CameraWidgetGroup *cagzgroup = gzgroup->customdata; + View3D *v3d = CTX_wm_view3d(C); ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = OBACT(view_layer); Camera *ca = ob->data; @@ -143,7 +149,9 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup) negate_v3_v3(dir, ob->obmat[2]); - if (ca->flag & CAM_SHOWLIMITS) { + if ((ca->flag & CAM_SHOWLIMITS) && + (v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_DOF_DIST)) + { WM_gizmo_set_matrix_location(cagzgroup->dop_dist, ob->obmat[3]); WM_gizmo_set_matrix_rotation_from_yz_axis(cagzgroup->dop_dist, ob->obmat[1], dir); WM_gizmo_set_scale(cagzgroup->dop_dist, ca->drawsize); @@ -232,6 +240,11 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup) WM_gizmo_target_property_def_rna_ptr(widget, gz_prop_type, &camera_ptr, prop, -1); } + /* This could be handled more elegently (split into two gizmo groups). */ + if ((v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_LENS) == 0) { + WM_gizmo_set_flag(cagzgroup->focal_len, WM_GIZMO_HIDDEN, true); + WM_gizmo_set_flag(cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true); + } } static void WIDGETGROUP_camera_message_subscribe( diff --git a/source/blender/editors/space_view3d/view3d_gizmo_empty.c b/source/blender/editors/space_view3d/view3d_gizmo_empty.c index b44e48a0670..8e78fe8a18e 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_empty.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_empty.c @@ -109,6 +109,9 @@ static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmGizmoGroupType *UN if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { return false; } + if ((v3d->gizmo_show_empty & V3D_GIZMO_SHOW_EMPTY_IMAGE) == 0) { + return false; + } ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c b/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c index 8aa5cca4cbf..34cf38b3466 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c @@ -52,6 +52,9 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmGizmoGroupType *UNU if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { return false; } + if ((v3d->gizmo_show_empty & V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD) == 0) { + return false; + } ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_light.c b/source/blender/editors/space_view3d/view3d_gizmo_light.c index f8f9951c20e..5fd5336f4ca 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_light.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_light.c @@ -54,6 +54,9 @@ static bool WIDGETGROUP_light_spot_poll(const bContext *C, wmGizmoGroupType *UNU if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { return false; } + if ((v3d->gizmo_show_light & V3D_GIZMO_SHOW_LIGHT_SIZE) == 0) { + return false; + } ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); @@ -159,7 +162,10 @@ static void gizmo_area_light_prop_matrix_set( static bool WIDGETGROUP_light_area_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_HIDE_OVERLAYS) { + if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { + return false; + } + if ((v3d->gizmo_show_light & V3D_GIZMO_SHOW_LIGHT_SIZE) == 0) { return false; } @@ -242,7 +248,10 @@ void VIEW3D_GGT_light_area(wmGizmoGroupType *gzgt) static bool WIDGETGROUP_light_target_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt)) { View3D *v3d = CTX_wm_view3d(C); - if (v3d->flag2 & V3D_HIDE_OVERLAYS) { + if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) { + return false; + } + if ((v3d->gizmo_show_light & V3D_GIZMO_SHOW_LIGHT_LOOK_AT) == 0) { return false; } |