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:
authorClément Foucault <foucault.clem@gmail.com>2019-03-23 21:28:13 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-23 21:28:13 +0300
commit16087eb911a7f3d65373478d45935cdc46cfd8fc (patch)
tree9be5bd8278aa7d1ac71b82d71853b2f3a5a5fcc1 /source/blender/draw/modes
parent839fe4e01c43328dd43562b03c68564e597d7e7f (diff)
Fix T62097 Bone transparancy not enabled when Xray enabled
This forces bone transparency / wireframe display when Xray is enabled. This makes sense as the bone transparency is a kind of Xray and should be linked to the Xray display.
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r--source/blender/draw/modes/edit_armature_mode.c4
-rw-r--r--source/blender/draw/modes/object_mode.c3
-rw-r--r--source/blender/draw/modes/pose_mode.c3
3 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index 2c47667a4e9..68f091da797 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -109,9 +109,11 @@ static void EDIT_ARMATURE_cache_populate(void *vedata, Object *ob)
if (arm->edbo) {
EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl;
EDIT_ARMATURE_StorageList *stl = ((EDIT_ARMATURE_Data *)vedata)->stl;
+ 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));
+ bool transp = (stl->g_data->transparent_bones || (ob->dt <= OB_WIRE)) ||
+ (draw_ctx->v3d->shading.flag & XRAY_FLAG(draw_ctx->v3d)) != 0;
DRWArmaturePasses passes = {
.bone_solid = (transp) ? psl->bone_transp[ghost] : psl->bone_solid[ghost],
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 05b6508e959..bce68623536 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -3143,7 +3143,8 @@ 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);
+ bool is_wire = (v3d->shading.type == OB_WIRE) || (ob->dt <= OB_WIRE) ||
+ (v3d->shading.flag & XRAY_FLAG(v3d)) != 0;
DRWArmaturePasses passes = {
.bone_solid = (is_wire) ? NULL : sgl->bone_solid,
.bone_outline = sgl->bone_outline,
diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c
index 01affecade4..c4050bf3f1a 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -198,7 +198,8 @@ 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));
+ bool transp = (ppd->transparent_bones || (ob->dt <= OB_WIRE)) ||
+ (draw_ctx->v3d->shading.flag & XRAY_FLAG(draw_ctx->v3d)) != 0;
DRWArmaturePasses passes = {
.bone_solid = (transp) ? psl->bone_transp[ghost] : psl->bone_solid[ghost],