diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-21 14:05:52 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-21 14:05:52 +0300 |
commit | f3b9ea066eeb2b69b81723c24cb5d9ffdbf0556f (patch) | |
tree | bfe587e7ece7c56a5623b504b59fd8201ddf33c4 /source/blender/editors/object/object_relations.c | |
parent | e3dba7d6f4fd99438aad6c27f82462e567b14ce5 (diff) |
Bugfix #21245: "Track to" (Ctrl + T) operator was missing notifier updates
Bugfix #21255: Clear track operator did not remove TrackTo constraints too. This could still be made to do Locked Track and other tracking constraints later too, but for now this will do.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 71b0dd82252..b2ccd96f3a7 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -873,9 +873,17 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { + /* remove track-object for old track */ ob->track= NULL; ob->recalc |= OB_RECALC; + /* also remove all Track To constraints + * TODO: + * - do we only want to do the last instance (use 1 as last arg instead) + * - also, what about other forms of tracking? + */ + remove_constraints_type(&ob->constraints, CONSTRAINT_TYPE_TRACKTO, 0); + if(type == 1) ED_object_apply_obmat(ob); } @@ -883,6 +891,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) DAG_ids_flush_update(0); DAG_scene_sort(CTX_data_scene(C)); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; } @@ -973,8 +982,10 @@ static int track_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } + DAG_scene_sort(scene); DAG_ids_flush_update(0); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; } |