Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2019-04-11 19:28:20 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-04-11 19:28:20 +0300
commitadaa7688ee77f4bce284b99ef5ac19a7c7a8ae42 (patch)
tree7b3dba7f17393d6be87f08086b946b085d4bd14d /source/blender/draw/modes
parent6b06440ed867189262034c26b483474fae670e60 (diff)
Fix T63467: Edge/vertex selection isnt working properly with X-ray set to 1
Edit mode shows the mesh elements in X-ray mode even if alpha is set to 1. Now the code takes this into account so that you can still select visible mesh elements in X-ray edit mode. view3d_draw_legacy need to be updated with the new XRAY flag macros to avoid crashes. Additional cleanup of the XRAY macro flags were done.
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r--source/blender/draw/modes/edit_armature_mode.c3
-rw-r--r--source/blender/draw/modes/edit_mesh_mode.c4
-rw-r--r--source/blender/draw/modes/object_mode.c6
-rw-r--r--source/blender/draw/modes/overlay_mode.c2
-rw-r--r--source/blender/draw/modes/pose_mode.c3
5 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index 26d232600d0..e2af2f10779 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -114,8 +114,7 @@ static void EDIT_ARMATURE_cache_populate(void *vedata, Object *ob)
const DRWContextState *draw_ctx = DRW_context_state_get();
int ghost = (ob->dtx & OB_DRAWXRAY) ? 1 : 0;
- bool transp = (stl->g_data->transparent_bones || (ob->dt <= OB_WIRE)) ||
- (draw_ctx->v3d->shading.flag & XRAY_FLAG(draw_ctx->v3d)) != 0;
+ bool transp = (stl->g_data->transparent_bones || (ob->dt <= OB_WIRE)) || XRAY_FLAG_ENABLED(draw_ctx->v3d);
DRWArmaturePasses passes = {
.bone_solid = (transp) ? psl->bone_transp[ghost] : psl->bone_solid[ghost],
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c
index 01bd43d9c6e..dedf7eac00a 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -387,7 +387,7 @@ static void EDIT_MESH_cache_init(void *vedata)
stl->g_data->do_faces = true;
stl->g_data->do_edges = true;
- stl->g_data->do_zbufclip = ((v3d)->shading.flag & XRAY_FLAG(v3d)) != 0;
+ stl->g_data->do_zbufclip = XRAY_FLAG_ENABLED(v3d);
stl->g_data->data_mask[0] = 0xFF; /* Face Flag */
stl->g_data->data_mask[1] = 0xFF; /* Edge Flag */
@@ -742,7 +742,7 @@ static void EDIT_MESH_draw_scene(void *vedata)
DRW_draw_pass(psl->normals);
DRW_draw_pass(psl->edit_face_overlay);
- if (v3d->shading.type == OB_SOLID && (v3d->shading.flag & XRAY_FLAG(v3d)) == 0 &&
+ if (v3d->shading.type == OB_SOLID && !XRAY_FLAG_ENABLED(v3d) &&
stl->g_data->ghost_ob == 1 && stl->g_data->edit_ob == 1)
{
/* In the case of single ghost object edit (common case for retopology):
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 11575cbf227..7b6519a6863 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1840,8 +1840,7 @@ static void camera_view3d_reconstruction(
BLI_assert(BLI_listbase_is_empty(&sgl->camera_path));
const bool is_solid_bundle = (v3d->bundle_drawtype == OB_EMPTY_SPHERE) &&
- ((v3d->shading.type != OB_SOLID) ||
- ((v3d->shading.flag & XRAY_FLAG(v3d)) == 0));
+ ((v3d->shading.type != OB_SOLID) || !XRAY_FLAG_ENABLED(v3d));
MovieTracking *tracking = &clip->tracking;
/* Index must start in 1, to mimic BKE_tracking_track_get_indexed. */
@@ -3155,8 +3154,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
bArmature *arm = ob->data;
if (arm->edbo == NULL) {
if (DRW_state_is_select() || !DRW_pose_mode_armature(ob, draw_ctx->obact)) {
- bool is_wire = (v3d->shading.type == OB_WIRE) || (ob->dt <= OB_WIRE) ||
- (v3d->shading.flag & XRAY_FLAG(v3d)) != 0;
+ bool is_wire = (v3d->shading.type == OB_WIRE) || (ob->dt <= OB_WIRE) || XRAY_FLAG_ENABLED(v3d);
DRWArmaturePasses passes = {
.bone_solid = (is_wire) ? NULL : sgl->bone_solid,
.bone_outline = sgl->bone_outline,
diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c
index 99102a22622..f2cafd51666 100644
--- a/source/blender/draw/modes/overlay_mode.c
+++ b/source/blender/draw/modes/overlay_mode.c
@@ -423,7 +423,7 @@ static void overlay_cache_finish(void *vedata)
View3D *v3d = ctx->v3d;
/* only in solid mode */
- if (v3d->shading.type == OB_SOLID && (v3d->shading.flag & XRAY_FLAG(v3d)) == 0) {
+ if (v3d->shading.type == OB_SOLID && !XRAY_FLAG_ENABLED(v3d)) {
if (stl->g_data->ghost_stencil_test) {
DRW_pass_state_add(psl->face_wireframe_pass, DRW_STATE_STENCIL_EQUAL);
}
diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c
index ec61eb99d52..cb90f944cbd 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -200,8 +200,7 @@ static void POSE_cache_populate(void *vedata, Object *ob)
}
if (DRW_pose_mode_armature(ob, draw_ctx->obact)) {
int ghost = (ob->dtx & OB_DRAWXRAY) ? 1 : 0;
- bool transp = (ppd->transparent_bones || (ob->dt <= OB_WIRE)) ||
- (draw_ctx->v3d->shading.flag & XRAY_FLAG(draw_ctx->v3d)) != 0;
+ bool transp = (ppd->transparent_bones || (ob->dt <= OB_WIRE)) || XRAY_FLAG_ENABLED(draw_ctx->v3d);
DRWArmaturePasses passes = {
.bone_solid = (transp) ? psl->bone_transp[ghost] : psl->bone_solid[ghost],