diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-16 17:42:46 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-16 17:48:52 +0400 |
commit | 61d14774150662a8cbcf439c7e93959fd3c74834 (patch) | |
tree | b33176bc131ae557ffdb96aafe9f19b10bd9f53e /source/blender | |
parent | bc411ec06ef429cc515313d9c87ec72a20c1e1ad (diff) |
Fix T42256: Translation operator moves Child-Of constrained objects in wrong space when only using parent's rotation and parent is rotated.
Just do not use crazyspace correction with childof constraints in this case.
Note this is only a very partial fix (partial use of parent loc on some axes
is still broken in transform), a real fix would probably require a full rewrite
of constraints handling in transform code (a mere static correction matrix
just cannot work in all possible cases, we'd need a full dynamic correction system here).
Anyway, transform code as a whole is horrible. :/
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 97515244422..8a5d313e3fb 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -185,6 +185,10 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob) /* calculate delta of constraints evaluation */ invert_m4_m4(imat, cob->startmat); + /* XXX This would seem to be in wrong order. However, it does not work in 'right' order - would be nice to + * understand why premul is needed here instead of usual postmul? + * In any case, we **do not get a delta** here (e.g. startmat & matrix having same location, still gives + * a 'delta' with non-null translation component :/ ).*/ mul_m4_m4m4(delta, cob->matrix, imat); /* copy matrices back to source */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index e27dafca9af..3b92e018d49 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4771,7 +4771,6 @@ static bool constraints_list_needinv(TransInfo *t, ListBase *list) /* (affirmative) returns for specific constraints here... */ /* constraints that require this regardless */ if (ELEM(con->type, - CONSTRAINT_TYPE_CHILDOF, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_OBJECTSOLVER, @@ -4781,7 +4780,14 @@ static bool constraints_list_needinv(TransInfo *t, ListBase *list) } /* constraints that require this only under special conditions */ - if (con->type == CONSTRAINT_TYPE_ROTLIKE) { + if (con->type == CONSTRAINT_TYPE_CHILDOF) { + /* ChildOf constraint only works when using all location components, see T42256. */ + bChildOfConstraint *data = (bChildOfConstraint *)con->data; + + if ((data->flag & CHILDOF_LOCX) && (data->flag & CHILDOF_LOCY) && (data->flag & CHILDOF_LOCZ)) + return true; + } + else if (con->type == CONSTRAINT_TYPE_ROTLIKE) { /* CopyRot constraint only does this when rotating, and offset is on */ bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data; |