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...
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user