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:
authorCampbell Barton <ideasman42@gmail.com>2010-11-09 01:32:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-09 01:32:28 +0300
commitc4967b5dde966a3342a835fc8831fa170f856a97 (patch)
tree07eb5779f0612c66a73a4eb88783b2072e6c707f /source/blender/editors/object/object_transform.c
parent0c27782b8e4b2eb8f756b081cef39c5ee089b032 (diff)
bugfix [#24616] Apply Visual Transform doesn't always apply location
- object updates were not being flushed, so children weren't updating. - apply the matrix relative to the parent, added this as an option to object_apply_mat4() which allows assigning the worldspace matrix in python without worrying about the parent.
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r--source/blender/editors/object/object_transform.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index bd8a7f99978..2917de2864b 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -391,7 +391,7 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob )
/* a change was made, adjust the children to compensate */
for(ob_child=bmain->object.first; ob_child; ob_child=ob_child->id.next) {
if(ob_child->parent == ob) {
- object_apply_mat4(ob_child, ob_child->obmat, TRUE);
+ object_apply_mat4(ob_child, ob_child->obmat, TRUE, FALSE);
what_does_parent(scene, ob_child, &workob);
invert_m4_m4(ob_child->parentinv, workob.obmat);
}
@@ -577,9 +577,12 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
where_is_object(scene, ob);
- object_apply_mat4(ob, ob->obmat, TRUE);
+ object_apply_mat4(ob, ob->obmat, TRUE, TRUE);
where_is_object(scene, ob);
-
+
+ /* update for any children that may get moved */
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+
change = 1;
}
CTX_DATA_END;