From 22605ec759a564428b82a3de1053c0152e9d9374 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 6 Oct 2009 11:33:58 +0000 Subject: Bone Selections: Ability to set bones as unselectable In the Outliner, it is now possible to toggle per bone the selectability of the bone in the viewport, as for Objects using the restriction columns. This can also be set using the RNA-api. I've tested all commonly used tools IMO, but there may still be a few which I've missed. Please report those cases. PS. For some reason, the define was already there, but not connected up to anything. Can't remember why anymore, but here it is... --- source/blender/editors/armature/poseobject.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/armature/poseobject.c') diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index d4b7aa149df..edbc7b9ae9b 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -543,7 +543,7 @@ void pose_select_constraint_target(Scene *scene) for (ct= targets.first; ct; ct= ct->next) { if ((ct->tar == ob) && (ct->subtarget[0])) { bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget); - if(pchanc) + if((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; } } @@ -582,7 +582,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *op) for (ct= targets.first; ct; ct= ct->next) { if ((ct->tar == ob) && (ct->subtarget[0])) { bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget); - if(pchanc) { + if((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) { pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; found= 1; } @@ -634,7 +634,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { curbone= pchan->bone; - if (arm->layer & curbone->layer) { + if ((arm->layer & curbone->layer) && (curbone->flag & BONE_UNSELECTABLE)==0) { if (curbone->flag & (BONE_ACTIVE)) { if (direction == BONE_SELECT_PARENT) { @@ -646,7 +646,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; curbone->flag &= ~BONE_ACTIVE; pabone->flag |= (BONE_ACTIVE|BONE_SELECTED); - + found= 1; break; } @@ -660,7 +660,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; curbone->flag &= ~BONE_ACTIVE; chbone->flag |= (BONE_ACTIVE|BONE_SELECTED); - + found= 1; break; } -- cgit v1.2.3