Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-10-10 18:57:29 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-10-10 20:45:11 +0400
commitb100bdca25b15df16c1cd3261f8151b824eb8b19 (patch)
tree6adb9dd9a322240a31348acb637136ed7fc337cc /source/blender/editors/object/object_relations.c
parent504370cafb1aaa36284688867fcaf7b29eb76848 (diff)
Fix T41950: Parent-Child Menu behaves weird
Issue was, parenting with operator, then unparenting would keep the inverse parent matrix. So if you then parented again through the mere Object field of Object buttons, you'd still use previous inver parent matrix, giving some weird behavior from user PoV. This commit simply makes sure inverse parent matrix is always reset to indentity when clearing parents.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index abc0516cf2b..74683cf43f8 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -506,12 +506,15 @@ void ED_object_parent_clear(Object *ob, int type)
}
case CLEAR_PARENT_INVERSE:
{
- /* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state) is cleared */
- unit_m4(ob->parentinv);
+ /* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state)
+ * is cleared. In other words: nothing to do here! */
break;
}
}
+ /* Always clear parentinv matrix for sake of consistency, see T41950. */
+ unit_m4(ob->parentinv);
+
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
}
@@ -556,6 +559,9 @@ void OBJECT_OT_parent_clear(wmOperatorType *ot)
void ED_object_parent(Object *ob, Object *par, int type, const char *substr)
{
+ /* Always clear parentinv matrix for sake of consistency, see T41950. */
+ unit_m4(ob->parentinv);
+
if (!par || BKE_object_parent_loop_check(par, ob)) {
ob->parent = NULL;
ob->partype = PAROBJECT;
@@ -655,6 +661,8 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
/* set the parent (except for follow-path constraint option) */
if (partype != PAR_PATH_CONST) {
ob->parent = par;
+ /* Always clear parentinv matrix for sake of consistency, see T41950. */
+ unit_m4(ob->parentinv);
}
/* handle types */