[Bf-blender-cvs] [6a43ee6] master: Fix T41128: Box selection bug with armatures.

Bastien Montagne noreply at git.blender.org
Mon Jul 21 15:55:07 CEST 2014


Commit: 6a43ee6e387824350f89e77f33c8907ff21d64ef
Author: Bastien Montagne
Date:   Mon Jul 21 15:49:16 2014 +0200
Branches: master
https://developer.blender.org/rB6a43ee6e387824350f89e77f33c8907ff21d64ef

Fix T41128: Box selection bug with armatures.

Calling `glLoadName()` was possible with '-1' value (65535 actually), in `draw_pose_bones()`...

Note I think bug exists since ages (at least, seems to be already present in 2008
when drawarmature.c was added in repo)!

Odd behavior reported (issue only affected objects once parented to the armature) was
due to ordering stuff, since only objects drawn *after* the armature were affected.

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

M	source/blender/editors/space_view3d/drawarmature.c

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

diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 37ac727..34634fc 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -1815,7 +1815,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
 		/* very very confusing... but in object mode, solid draw, we cannot do glLoadName yet,
 		 * stick bones and/or wire custom-shapes are drawn in next loop 
 		 */
-		if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && (draw_wire == false)) {
+		if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && (draw_wire == false) && index != -1) {
 			/* object tag, for bordersel optim */
 			glLoadName(index & 0xFFFF);
 			index = -1;
@@ -1881,7 +1881,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
 				index += 0x10000;  /* pose bones count in higher 2 bytes only */
 		}
 		/* stick or wire bones have not been drawn yet so don't clear object selection in this case */
-		if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && draw_wire) {
+		if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && draw_wire && index != -1) {
 			/* object tag, for bordersel optim */
 			glLoadName(index & 0xFFFF);
 			index = -1;




More information about the Bf-blender-cvs mailing list