Cleanup: rename bone-select to xray
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Nov 2018 02:46:40 +0000 (13:46 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Nov 2018 02:48:21 +0000 (13:48 +1100)
This shows bones in font and uses the xray toggle binding.
Also 'bone select' isn't very meaningful on it's own.

release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/screen.c
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/engines/gpencil/gpencil_draw_utils.c
source/blender/draw/intern/DRW_render.h
source/blender/draw/modes/pose_mode.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_space.c

index 42cf680a521e612d836093a6bb317b3ac8613668..0542fe6025b2ec9c9831ea8aa66793e3d7c82ab1 100644 (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):
index 84962e9b03fc6e2ae67fd76de52623d785d6713f..0c93281bf848ecfdaa1dc83ed9d6d873f568c2da 100644 (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;
index a28b4ae77844ddde12dbe7d9ccee15d27aa08c31..d0e791fc1d66e4ab37157190b87c5e74c264575c 100644 (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;
                                                }
                                        }
                                }
index 40b6a4e5b2b2b6f8738f1830b4f62eca9cfda551..c8b70953f87efa04c86c8429cc9ac2a5498ebaa0 100644 (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) &&
index 9bf3ce1516682fa8b91149bef2e7ef94cd3609b9..faba85c9b467dd17d86264b6ab89a6dbbb87ede5 100644 (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__ */
index 81466f19128d2a72aa1679257ecad9f834aecd97..3c0a8048c9ea44c088e865c2060e666088b591a3 100644 (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;
index 78b51dad8d14d43bdbfadae959dbf8be2f783bac..cdbef05a34b652cf92e93c2668a74f173665cea7 100644 (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);
index 91b13e1ac87603461feeebbee3ac8699995d3b31..0e8e5e1ee22e1a1767b0a1709d0222c78c45066e 100644 (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;
index c94aab1a3c1cae056175eaa46e0f156521f54f04..5f0ce77703d505e7813dc9b7988f85213f3c7af5 100644 (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;
index d0880b0af9ae01343dedfa47f32e8c4155392845..30b3f0ba6889c8fb3e82035bb7830b59e6533fcf 100644 (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 */
index ee00d8975304d807db00d5a6fd555bceefe83d49..774fbe1f7ba4ea223d18c6b03457201e075c2651 100644 (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);