diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-02-17 09:17:01 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-02-17 09:17:01 +0300 |
commit | 0ce7e6c7b1d9838d74ff086818893ab0c3cd8f54 (patch) | |
tree | 215a0404b5764ce749999ac75cc605bb41ce3b77 /source/blender/src/transform.c | |
parent | dafd23e5c63e0215d113b7263082540ef083c2d4 (diff) |
Bugfix: Limit Constraints
Rot/Scale-Limit Constraints with 'For Transform' option would sometimes act on location values too.
Diffstat (limited to 'source/blender/src/transform.c')
-rw-r--r-- | source/blender/src/transform.c | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 503b3fb521c..8f8601da88e 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1941,47 +1941,34 @@ static void constraintTransLim(TransInfo *t, TransData *td) /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { float tmat[4][4]; - + /* only use it if it's tagged for this purpose (and the right type) */ if (con->type == CONSTRAINT_TYPE_LOCLIMIT) { bLocLimitConstraint *data= con->data; + if ((data->flag2 & LIMIT_TRANSFORM)==0) continue; - } - else if (con->type == CONSTRAINT_TYPE_ROTLIMIT) { - bRotLimitConstraint *data= con->data; - if ((data->flag2 & LIMIT_TRANSFORM)==0) - continue; - } - else if (con->type == CONSTRAINT_TYPE_SIZELIMIT) { - bSizeLimitConstraint *data= con->data; - if ((data->flag2 & LIMIT_TRANSFORM)==0) + + /* do space conversions */ + if (con->ownspace == CONSTRAINT_SPACE_WORLD) { + /* just multiply by td->mtx (this should be ok) */ + Mat4CpyMat4(tmat, cob.matrix); + Mat4MulMat34(cob.matrix, td->mtx, tmat); + } + else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) { + /* skip... incompatable spacetype */ continue; - } - else { - /* not supported */ - continue; - } + } - /* do space conversions */ - if (con->ownspace == CONSTRAINT_SPACE_WORLD) { - /* just multiply by td->mtx (this should be ok) */ - Mat4CpyMat4(tmat, cob.matrix); - Mat4MulMat34(cob.matrix, td->mtx, tmat); - } - else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) { - /* skip... incompatable spacetype */ - continue; - } - - /* do constraint */ - cti->evaluate_constraint(con, &cob, NULL); - - /* convert spaces again */ - if (con->ownspace == CONSTRAINT_SPACE_WORLD) { - /* just multiply by td->mtx (this should be ok) */ - Mat4CpyMat4(tmat, cob.matrix); - Mat4MulMat34(cob.matrix, td->smtx, tmat); + /* do constraint */ + cti->evaluate_constraint(con, &cob, NULL); + + /* convert spaces again */ + if (con->ownspace == CONSTRAINT_SPACE_WORLD) { + /* just multiply by td->mtx (this should be ok) */ + Mat4CpyMat4(tmat, cob.matrix); + Mat4MulMat34(cob.matrix, td->smtx, tmat); + } } } |