diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-09-26 21:31:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-09-26 21:31:20 +0300 |
commit | 5732d9e1dcc08d284d7f9f56be22ad901fd53f22 (patch) | |
tree | b95990cabfe96e39b8a14883c6166e10bd9918fb /source/blender/editors | |
parent | ebd234eee5d7fdae6d7a5efa56171f6ab773a9e1 (diff) |
Wireframe/Xray: Make Xray option local to wireframe mode
This commit make the Xray option for the wireframe different from the other
shading mode. This makes it possible to rapidly switch between wireframe +
Xray and Solid mode without Xray.
Xray alpha is also decoupled.
Both variables are duplicated and exposed separately through RNA.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 605c9bc3d97..713cc21c8ec 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -535,8 +535,8 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *ar); void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *sa); -#define V3D_IS_ZBUF(v3d) \ - (((v3d)->shading.flag & V3D_SHADING_XRAY) == 0) +#define V3D_XRAY_FLAG(v3d) (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY) +#define V3D_IS_ZBUF(v3d) (((v3d)->shading.flag & V3D_XRAY_FLAG(v3d)) == 0) void ED_view3d_id_remap(struct View3D *v3d, const struct ID *old_id, struct ID *new_id); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 68e9053101e..ca4fe0ad67b 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1009,7 +1009,7 @@ int view3d_opengl_select( } /* If in xray mode, we select the wires in priority. */ - if (v3d->shading.flag & V3D_SHADING_XRAY) { + if (v3d->shading.flag & V3D_XRAY_FLAG(v3d)) { /* We need to call "GPU_select_*" API's inside DRW_draw_select_loop * because the OpenGL context created & destroyed inside this function. */ struct DrawSelectLoopUserData drw_select_loop_user_data = { diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 00d521fc81c..7b8f95dfeaa 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -2601,7 +2601,7 @@ static short transform_snap_context_project_view3d_mixed_impl( bool use_occlusion_test = params->use_occlusion_test && - !(sctx->v3d_data.v3d->shading.flag & V3D_SHADING_XRAY); + !(sctx->v3d_data.v3d->shading.flag & V3D_XRAY_FLAG(sctx->v3d_data.v3d)); if (snap_to_flag & SCE_SNAP_MODE_FACE || use_occlusion_test) { float ray_start[3], ray_normal[3]; |