Cleanup: rename bone-select to xray

This shows bones in font and uses the xray toggle binding.
Also 'bone select' isn't very meaningful on it's own.
This commit is contained in:
Campbell Barton 2018-11-23 13:46:40 +11:00
parent 3fdcd2293e
commit d56c0a0a6a
Notes: blender-bot 2023-02-14 01:07:44 +01:00
Referenced by commit d63438e4d1, Cleanup: correct wireframe xray flag name
11 changed files with 21 additions and 21 deletions

View File

@ -4832,13 +4832,13 @@ class VIEW3D_PT_overlay_pose(Panel):
if mode == 'POSE':
row = col.row()
row.prop(overlay, "show_bone_select", text="")
row.prop(overlay, "show_xray_bone", text="")
sub = row.row()
sub.active = display_all and overlay.show_bone_select
sub.prop(overlay, "bone_select_alpha", text="Fade Geometry")
sub.active = display_all and overlay.show_xray_bone
sub.prop(overlay, "xray_alpha_bone", text="Fade Geometry")
else:
row = col.row()
row.prop(overlay, "show_bone_select")
row.prop(overlay, "show_xray_bone")
class VIEW3D_PT_overlay_edit_armature(Panel):

View File

@ -787,7 +787,7 @@ void BKE_screen_view3d_shading_init(View3DShading *shading)
shading->type = OB_SOLID;
shading->prev_type = OB_SOLID;
shading->flag = V3D_SHADING_SPECULAR_HIGHLIGHT | V3D_SHADING_XRAY_WIREFRAME;
shading->flag = V3D_SHADING_SPECULAR_HIGHLIGHT | V3D_SHADING_XRAY_BONE;
shading->light = V3D_LIGHTING_STUDIO;
shading->shadow_intensity = 0.5f;
shading->xray_alpha = 0.5f;

View File

@ -1727,13 +1727,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "bone_select_alpha")) {
if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "xray_alpha_bone")) {
for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
v3d->overlay.bone_select_alpha = 0.5f;
v3d->overlay.xray_alpha_bone = 0.5f;
}
}
}
@ -2152,7 +2152,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
v3d->shading.flag |= V3D_SHADING_XRAY_WIREFRAME;
v3d->shading.flag |= V3D_SHADING_XRAY_BONE;
}
}
}

View File

@ -1508,7 +1508,7 @@ void DRW_gpencil_populate_datablock(
if ((draw_ctx->obact) && (draw_ctx->object_mode == OB_MODE_POSE) &&
(v3d->overlay.flag & V3D_OVERLAY_BONE_SELECT))
{
opacity = opacity * v3d->overlay.bone_select_alpha;
opacity = opacity * v3d->overlay.xray_alpha_bone;
}
/* fade no active layers */
if ((overlay) && (draw_ctx->object_mode == OB_MODE_GPENCIL_PAINT) &&

View File

@ -592,7 +592,7 @@ typedef struct DRWContextState {
const DRWContextState *DRW_context_state_get(void);
#define XRAY_ALPHA(v3d) (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha)
#define XRAY_FLAG(v3d) (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
#define XRAY_FLAG(v3d) (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_BONE : V3D_SHADING_XRAY)
#define XRAY_ENABLED(v3d) ((((v3d)->shading.flag & XRAY_FLAG(v3d)) != 0) && (XRAY_ALPHA(v3d) < 1.0f))
#endif /* __DRW_RENDER_H__ */

View File

@ -147,7 +147,7 @@ static void POSE_cache_init(void *vedata)
{
if (POSE_is_bone_selection_overlay_active()) {
const float alpha = (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) ? 0.0f : v3d->overlay.bone_select_alpha;
const float alpha = (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) ? 0.0f : v3d->overlay.xray_alpha_bone;
copy_v4_fl4(ppd->blend_color, 0.0f, 0.0f, 0.0f, alpha);
copy_v4_fl4(ppd->blend_color_invert, 0.0f, 0.0f, 0.0f, pow(alpha, 4));
DRWShadingGroup *grp;

View File

@ -544,7 +544,7 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx,
void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *ar);
void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *sa);
#define V3D_XRAY_FLAG(v3d) (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
#define V3D_XRAY_FLAG(v3d) (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_BONE : V3D_SHADING_XRAY)
#define V3D_IS_ZBUF(v3d) (((v3d)->shading.flag & V3D_XRAY_FLAG(v3d)) == 0)
void ED_view3d_id_remap(struct View3D *v3d, const struct ID *old_id, struct ID *new_id);

View File

@ -325,7 +325,7 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
BKE_screen_view3d_shading_init(&v3d->shading);
v3d->overlay.wireframe_threshold = 0.5f;
v3d->overlay.bone_select_alpha = 0.5f;
v3d->overlay.xray_alpha_bone = 0.5f;
v3d->overlay.texture_paint_mode_opacity = 0.8;
v3d->overlay.weight_paint_mode_opacity = 1.0f;
v3d->overlay.vertex_paint_mode_opacity = 0.8;

View File

@ -4942,7 +4942,7 @@ static int toggle_xray_exec(bContext *C, wmOperator *op)
ELEM(v3d->shading.type, OB_WIRE, OB_SOLID));
if (v3d->shading.type == OB_WIRE) {
v3d->shading.flag ^= V3D_SHADING_XRAY_WIREFRAME;
v3d->shading.flag ^= V3D_SHADING_XRAY_BONE;
}
else {
v3d->shading.flag ^= V3D_SHADING_XRAY;

View File

@ -188,7 +188,7 @@ typedef struct View3DOverlay {
/* Armature edit/pose mode settings */
int arm_flag;
float bone_select_alpha;
float xray_alpha_bone;
/* Other settings */
float wireframe_threshold;
@ -389,7 +389,7 @@ enum {
V3D_SHADING_CAVITY = (1 << 5),
V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
V3D_SHADING_SCENE_WORLD = (1 << 7),
V3D_SHADING_XRAY_WIREFRAME = (1 << 8),
V3D_SHADING_XRAY_BONE = (1 << 8),
};
/* View3DShading->color_type */

View File

@ -2550,7 +2550,7 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "show_xray_wireframe", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SHADING_XRAY_WIREFRAME);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SHADING_XRAY_BONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
@ -2733,14 +2733,14 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "show_bone_select", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "show_xray_bone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_BONE_SELECT);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Bone Selection", "Show the Bone Selection Overlay");
RNA_def_property_ui_text(prop, "Show Bone X-Ray", "Show the bone selection overlay");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
prop = RNA_def_property(srna, "bone_select_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "overlay.bone_select_alpha");
prop = RNA_def_property(srna, "xray_alpha_bone", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "overlay.xray_alpha_bone");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_ui_text(prop, "Opacity", "Opacity to use for bone selection");
RNA_def_property_range(prop, 0.0f, 1.0f);