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:
authorCampbell Barton <ideasman42@gmail.com>2009-11-10 00:03:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-10 00:03:54 +0300
commit5935ef004935b27fc5795349aed32f87cf637049 (patch)
treef36022abb03938420606405e9afc841b14d4bd81 /source/blender/editors/space_view3d/view3d_select.c
parent3e2766bc2ee7523ea68caedc5b11e9498ddcbbc1 (diff)
use armature active bone as a pointer rather then a flag for each bone that needs looking up.
- rna vars arm.bones.active & rna.edit_bones.active - needed special undo support. - readfile.c loads. - duplicate and copy_armature support. - keep the draw flag, renamed to BONE_DRAW_ACTIVE, only use for openGL drawing. Note: it may be better to allow active/unselected as with objects.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index f0425974f29..2505110d766 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -357,7 +357,14 @@ static void do_lasso_select_pose(ViewContext *vc, short mcords[][2], short moves
if(lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
if(select) pchan->bone->flag |= BONE_SELECTED;
- else pchan->bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED);
+ else pchan->bone->flag &= ~BONE_SELECTED;
+ }
+ }
+
+ {
+ bArmature *arm= ob->data;
+ if((arm->act_bone->flag & BONE_SELECTED)==0) {
+ arm->act_bone= NULL;
}
}
}
@@ -638,9 +645,11 @@ static void do_lasso_select_armature(ViewContext *vc, short mcords[][2], short m
/* if one of points selected, we skip the bone itself */
if(didpoint==0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
if(select) ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED;
- else ebone->flag &= ~(BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ else ebone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
}
+
+ ED_armature_validate_active(arm);
}
static void do_lasso_select_facemode(ViewContext *vc, short mcords[][2], short moves, short select)
@@ -1534,8 +1543,12 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
// XXX select_actionchannel_by_name(base->object->action, bone->name, 1);
}
else {
- bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED);
+ bArmature *arm= base->object->data;
+ bone->flag &= ~BONE_SELECTED;
// XXX select_actionchannel_by_name(base->object->action, bone->name, 0);
+ if(arm->act_bone==bone)
+ arm->act_bone= NULL;
+
}
}
}
@@ -1868,9 +1881,11 @@ static void armature_circle_select(ViewContext *vc, int selecting, short *mval,
if (selecting)
ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED;
else
- ebone->flag &= ~(BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ ebone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
}
+
+ ED_armature_validate_active(arm);
}
/** Callbacks for circle selection in Editmode */