Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-07-21 17:49:16 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-07-21 17:54:32 +0400
commit6a43ee6e387824350f89e77f33c8907ff21d64ef (patch)
treee80cbcd38932c6f262461122821beebe9b959a43
parenta7d8f602a6f60a0c117615c0493315e4de9dd9e2 (diff)
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.
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 37ac7272cb1..34634fc1807 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;