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

@ -5192,7 +5192,6 @@ class VIEW3D_PT_overlay_pose(Panel):
col = layout.column()
col.active = display_all
col.prop(overlay, "show_transparent_bones")
if mode == 'POSE':
row = col.row()
@ -5205,27 +5204,6 @@ class VIEW3D_PT_overlay_pose(Panel):
row.prop(overlay, "show_xray_bone")
class VIEW3D_PT_overlay_edit_armature(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
bl_parent_id = 'VIEW3D_PT_overlay'
bl_label = "Armature Edit Mode"
@classmethod
def poll(cls, context):
return context.mode == 'EDIT_ARMATURE'
def draw(self, context):
layout = self.layout
view = context.space_data
overlay = view.overlay
display_all = overlay.show_overlays
col = layout.column()
col.active = display_all
col.prop(overlay, "show_transparent_bones")
class VIEW3D_PT_overlay_paint(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
@ -5916,7 +5894,6 @@ classes = (
VIEW3D_PT_overlay_edit_mesh_freestyle,
VIEW3D_PT_overlay_edit_mesh_developer,
VIEW3D_PT_overlay_edit_curve,
VIEW3D_PT_overlay_edit_armature,
VIEW3D_PT_overlay_paint,
VIEW3D_PT_overlay_pose,
VIEW3D_PT_overlay_sculpt,

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);