diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-12-11 07:15:47 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-12-11 07:19:42 +0400 |
commit | fcdc04af4f7c7c799dab5e5a38942ad6cc55b3d5 (patch) | |
tree | 13287db25f1e83275a3b0c36d93b37c508746c82 /source/blender/editors/transform | |
parent | 71d5fe29da4db1174b8aa3d863a73fdf0d62f37b (diff) |
Fix T37755: Autokey doesn't work for local Z-Axis in Camera view with MotionPaths enabled
The problem here was that the hack used to fix T24551 in r32863
would cause the camera to jump back to its pre-transform position
after motionpaths were recalculated. This made it seem like a keyframe
wasn't inserted by AutoKeying (even though it was).
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4c0a358a187..c41b4deca31 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5143,6 +5143,22 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } + /* only calculate paths if there are paths to be recalculated, + * assuming that since we've autokeyed the transforms this is + * now safe to apply... + * + * NOTE: only do this when there's context info + */ + if (C && (ob->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) { + //ED_objects_clear_paths(C); // XXX for now, don't need to clear + ED_objects_recalculate_paths(C, scene); + + /* XXX: there's potential here for problems with unkeyed rotations/scale, + * but for now (until proper data-locality for baking operations), + * this should be a better fix for T24451 and T37755 + */ + } + /* free temp info */ BLI_freelistN(&dsources); } @@ -5787,7 +5803,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* do nothing */ } else { /* Objects */ - int i, recalcObPaths = 0; + int i; BLI_assert(t->flag & (T_OBJECT | T_TEXTURE)); @@ -5824,11 +5840,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* Set autokey if necessary */ if (!canceled) { autokeyframe_ob_cb_func(C, t->scene, (View3D *)t->view, ob, t->mode); - - /* only calculate paths if there are paths to be recalculated */ - if (ob->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) - recalcObPaths = 1; } + /* restore rigid body transform */ if (ob->rigidbody_object && canceled) { float ctime = BKE_scene_frame_get(t->scene); @@ -5836,25 +5849,6 @@ void special_aftertrans_update(bContext *C, TransInfo *t) BKE_rigidbody_aftertrans_update(ob, td->ext->oloc, td->ext->orot, td->ext->oquat, td->ext->orotAxis, td->ext->orotAngle); } } - - /* recalculate motion paths for objects (if necessary) - * NOTE: only do this when there is context info - */ - if (C && recalcObPaths) { - //ED_objects_clear_paths(C); // XXX for now, don't need to clear - ED_objects_recalculate_paths(C, t->scene); - - /* recalculating the frame positions means we loose our original transform if its not auto-keyed [#24451] - * this hack re-applies it, which is annoying, only alternatives are... - * - don't recalc paths. - * - have an BKE_object_handle_update() which gives is the new transform without touching the objects. - * - only recalc paths on auto-keying. - * - ED_objects_recalculate_paths could backup/restore transforms. - * - re-apply the transform which is simplest in this case. (2 lines below) - */ - t->redraw |= TREDRAW_HARD; - transformApply(C, t); - } } clear_trans_object_base_flags(t); |