[Bf-blender-cvs] [b23404d701c] blender2.8: 3D View: overlay option to show bones

Campbell Barton noreply at git.blender.org
Tue Jul 10 14:10:47 CEST 2018


Commit: b23404d701c3b16931711ac534218c77d2e97a2a
Author: Campbell Barton
Date:   Tue Jul 10 14:10:12 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb23404d701c3b16931711ac534218c77d2e97a2a

3D View: overlay option to show bones

Allows drawing motion paths without the bones.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/draw/modes/pose_mode.c
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 27950060fed..cf2c9641971 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3897,6 +3897,7 @@ class VIEW3D_PT_overlay(Panel):
         #sub.prop(overlay, "show_onion_skins")
         sub.prop(overlay, "show_face_orientation")
         sub.prop(overlay, "show_backface_culling")
+        sub.prop(overlay, "show_bones", text="Bones")
         if shading.type == 'MATERIAL':
             sub.prop(overlay, "show_look_dev")
 
diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c
index 84c3bff406a..2c24b29c881 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -202,6 +202,9 @@ static void POSE_cache_populate(void *vedata, Object *ob)
 	 * and similar functionalities. For now we handle only pose bones. */
 
 	if (ob->type == OB_ARMATURE) {
+		if (draw_ctx->v3d->overlay.flag & V3D_OVERLAY_HIDE_BONES) {
+			return;
+		}
 		if (DRW_pose_mode_armature(ob, draw_ctx->obact)) {
 			DRWArmaturePasses passes = {
 			    .bone_solid = psl->bone_solid,
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 331eb216f61..1f0476e9db7 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -386,6 +386,7 @@ enum {
 	V3D_OVERLAY_HIDE_TEXT         = (1 << 5),
 	V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
 	V3D_OVERLAY_ONION_SKINS       = (1 << 7),
+	V3D_OVERLAY_HIDE_BONES        = (1 << 8),
 };
 
 /* View3DOverlay->edit_flag */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 78174c10128..81efcf3c4dd 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2637,6 +2637,11 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Show Text", "Display overlay text");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
+	prop = RNA_def_property(srna, "show_bones", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_BONES);
+	RNA_def_property_ui_text(prop, "Show Bones", "Display bones");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
 	prop = RNA_def_property(srna, "show_face_orientation", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION);
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);



More information about the Bf-blender-cvs mailing list