Fix T52224: auto IK not respecting length, after recent bugfix.

This commit is contained in:
Brecht Van Lommel
2017-07-31 19:22:03 +02:00
parent 66110c6b98
commit becb413f29

View File

@@ -807,7 +807,6 @@ static bool pchan_autoik_adjust(bPoseChannel *pchan, short chainlen)
/* change the chain-length of auto-ik */
void transform_autoik_update(TransInfo *t, short mode)
{
const short old_len = t->settings->autoik_chainlen;
short *chainlen = &t->settings->autoik_chainlen;
bPoseChannel *pchan;
@@ -818,12 +817,13 @@ void transform_autoik_update(TransInfo *t, short mode)
}
else if (mode == -1) {
/* mode==-1 is from WHEELMOUSEUP... decreases len */
if (*chainlen > 0) (*chainlen)--;
}
/* IK length did not change, skip any updates. */
if (old_len == *chainlen) {
return;
if (*chainlen > 0) {
(*chainlen)--;
}
else {
/* IK length did not change, skip updates. */
return;
}
}
/* sanity checks (don't assume t->poseobj is set, or that it is an armature) */