diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-03-09 11:31:41 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-03-09 11:31:41 +0300 |
commit | 6a4b39ed2ce9e44139e91a4daab9ccf6caff0375 (patch) | |
tree | c6780c716c31f9d3d97ea86ac54bfbdcd7a0c4b5 /source/blender/editors/transform | |
parent | ec303cf980a696fa374dad3b1cdfd6440ed7f846 (diff) |
Bugfix #21508: Hidden bones remain "selected" and are affected by transforms
Made hidden bones get ignored by transform code. This should be quite an old bug...
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 13 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 11 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5c29650b987..5fd96e466b0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -712,14 +712,14 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob) int hastranslation = 0; int total = 0; - for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { bone = pchan->bone; - if(bone->layer & arm->layer) { - if((bone->flag & BONE_SELECTED) && !(ob->proxy && pchan->bone->layer & arm->layer_protected)) + if ((bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) { + if ((bone->flag & BONE_SELECTED) && !(ob->proxy && pchan->bone->layer & arm->layer_protected)) bone->flag |= BONE_TRANSFORM; else bone->flag &= ~BONE_TRANSFORM; - + bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM; bone->flag &= ~BONE_TRANSFORM_CHILD; } @@ -1068,7 +1068,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) t->total = 0; for (ebo = edbo->first; ebo; ebo = ebo->next) { - if(ebo->layer & arm->layer) + if (EBONE_VISIBLE(arm, ebo) && !(ebo->flag & BONE_EDITMODE_LOCKED)) { if (t->mode==TFM_BONESIZE) { @@ -1101,7 +1101,8 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) { ebo->oldlength = ebo->length; // length==0.0 on extrude, used for scaling radius of bone points - if(ebo->layer & arm->layer) { + if (EBONE_VISIBLE(arm, ebo) && !(ebo->flag & BONE_EDITMODE_LOCKED)) + { if (t->mode==TFM_BONE_ENVELOPE) { if (ebo->flag & BONE_ROOTSEL) diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 4ca821e2b01..8d7c5c820d0 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -326,7 +326,7 @@ static int fcu_test_selected(FCurve *fcu) BezTriple *bezt= fcu->bezt; int i; - if(bezt==NULL) /* ignore baked */ + if (bezt==NULL) /* ignore baked */ return 0; for (i=0; i < fcu->totvert; i++, bezt++) { @@ -422,11 +422,11 @@ void recalcData(TransInfo *t) /* now test if there is a need to re-sort */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - + /* ignore unselected fcurves */ - if(!fcu_test_selected(fcu)) + if (!fcu_test_selected(fcu)) continue; - + // fixme: only do this for selected verts... ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYSEL|ANIM_UNITCONV_SELVERTS|ANIM_UNITCONV_RESTORE); @@ -442,7 +442,6 @@ void recalcData(TransInfo *t) */ if ((sipo->flag & SIPO_NOREALTIMEUPDATES) == 0) ANIM_list_elem_update(t->scene, ale); - } /* do resort and other updates? */ @@ -1111,7 +1110,7 @@ void postTrans (bContext *C, TransInfo *t) if (t->data) { int a; - /* since ipokeys are optional on objects, we mallocced them per trans-data */ + /* free data malloced per trans-data */ for(a=0, td= t->data; a<t->total; a++, td++) { if (td->flag & TD_BEZTRIPLE) MEM_freeN(td->hdata); |