[Bf-blender-cvs] [16087eb911a] master: Fix T62097 Bone transparancy not enabled when Xray enabled
Clément Foucault
noreply at git.blender.org
Sat Mar 23 19:28:27 CET 2019
Commit: 16087eb911a7f3d65373478d45935cdc46cfd8fc
Author: Clément Foucault
Date: Sat Mar 23 19:28:13 2019 +0100
Branches: master
https://developer.blender.org/rB16087eb911a7f3d65373478d45935cdc46cfd8fc
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.
===================================================================
M source/blender/draw/modes/edit_armature_mode.c
M source/blender/draw/modes/object_mode.c
M source/blender/draw/modes/pose_mode.c
===================================================================
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],
More information about the Bf-blender-cvs
mailing list