Orange: More fixes in bone-layers (#$@%!).

- constraint buttons were drawing the hidden bone settings
- ctrl+I or 'Add constraint' didn't respect layers yet
This commit is contained in:
2005-12-08 15:05:14 +00:00
parent 42ec7a2afa
commit 4b7bc941e5
2 changed files with 9 additions and 6 deletions

View File

@@ -587,18 +587,20 @@ void add_constraint(int only_IK)
/* paranoia checks */
if(ob==NULL || ob==G.obedit) return;
if(ob->pose && (ob->flag & OB_POSEMODE)) {
bArmature *arm= ob->data;
/* find active channel */
for(pchanact= ob->pose->chanbase.first; pchanact; pchanact= pchanact->next)
if(pchanact->bone->flag & BONE_ACTIVE) break;
pchanact= get_active_posechannel(ob);
if(pchanact==NULL) return;
/* find selected bone */
for(pchansel= ob->pose->chanbase.first; pchansel; pchansel= pchansel->next) {
if(pchansel!=pchanact)
if(pchansel->bone->flag & BONE_SELECTED) break;
if(pchansel->bone->flag & BONE_SELECTED)
if(pchansel->bone->layer & arm->layer)
break;
}
}