Armature: Remove the Transparent Bone overlay option

The option is replaced by the Wireframe mode display which (in edit & pose
mode) does exactly what transparent bones did.
This commit is contained in:
Clément Foucault
2019-02-27 17:35:43 +01:00
parent fe5d26807b
commit 28ccc0fa2f
5 changed files with 3 additions and 45 deletions

View File

@@ -70,8 +70,7 @@ static void EDIT_ARMATURE_cache_init(void *vedata)
/* Alloc transient pointers */
stl->g_data = MEM_callocN(sizeof(*stl->g_data), __func__);
}
stl->g_data->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE) ||
(draw_ctx->v3d->overlay.arm_flag & V3D_OVERLAY_ARM_TRANSP_BONES) != 0;
stl->g_data->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE);
for (int i = 0; i < 2; ++i) {
/* Solid bones */

View File

@@ -111,8 +111,7 @@ static void POSE_cache_init(void *vedata)
stl->g_data = MEM_callocN(sizeof(*stl->g_data), __func__);
}
POSE_PrivateData *ppd = stl->g_data;
ppd->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE) ||
(draw_ctx->v3d->overlay.arm_flag & V3D_OVERLAY_ARM_TRANSP_BONES) != 0;
ppd->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE);
for (int i = 0; i < 2; ++i) {
/* Solid bones */
@@ -258,8 +257,6 @@ static void POSE_draw_scene(void *vedata)
POSE_PassList *psl = ((POSE_Data *)vedata)->psl;
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
const DRWContextState *draw_ctx = DRW_context_state_get();
const bool transparent_bones = (draw_ctx->v3d->overlay.arm_flag & V3D_OVERLAY_ARM_TRANSP_BONES) != 0;
const bool bone_selection_overlay = POSE_is_bone_selection_overlay_active();
if (DRW_state_is_select()) {
@@ -302,11 +299,6 @@ static void POSE_draw_scene(void *vedata)
GPU_framebuffer_clear_depth(dfbl->default_fb, 1.0f);
}
if (transparent_bones) {
DRW_pass_state_add(psl->bone_solid[1], DRW_STATE_BLEND);
DRW_pass_state_remove(psl->bone_solid[1], DRW_STATE_WRITE_DEPTH);
}
DRW_draw_pass(psl->bone_envelope[1]);
DRW_draw_pass(psl->bone_solid[1]);
DRW_draw_pass(psl->bone_transp[1]);

View File

@@ -211,7 +211,7 @@ typedef struct View3DOverlay {
float weight_paint_mode_opacity;
/* Armature edit/pose mode settings */
int arm_flag;
int _pad3;
float xray_alpha_bone;
/* Other settings */
@@ -491,11 +491,6 @@ enum {
V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
};
/* View3DOverlay->arm_flag */
enum {
V3D_OVERLAY_ARM_TRANSP_BONES = (1 << 0),
};
/* View3DOverlay->paint_flag */
enum {
V3D_OVERLAY_PAINT_WIRE = (1 << 0),

View File

@@ -2951,11 +2951,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "show_transparent_bones", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "overlay.arm_flag", V3D_OVERLAY_ARM_TRANSP_BONES);
RNA_def_property_ui_text(prop, "Transparent Bones", "Display bones as transparent");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "texture_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "overlay.texture_paint_mode_opacity");
RNA_def_property_float_default(prop, 1.0f);