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/blenkernel/intern/constraint.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/blenkernel/intern/constraint.c')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index fe2e009918c..c22510a2527 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3903,6 +3903,26 @@ int remove_constraint_index (ListBase *list, int index) return 0; } +/* Remove all the constraints of the specified type from the given constraint stack */ +void remove_constraints_type (ListBase *list, short type, short last_only) +{ + bConstraint *con, *conp; + + if (list == NULL) + return; + + /* remove from the end of the list to make it faster to find the last instance */ + for (con= list->last; con; con= conp) { + conp= con->prev; + + if (con->type == type) { + remove_constraint(list, con); + if (last_only) + return; + } + } +} + /* ......... */ /* Creates a new constraint, initialises its data, and returns it */ @@ -4062,9 +4082,6 @@ void copy_constraints (ListBase *dst, const ListBase *src) /* make a new copy of the constraint's data */ con->data = MEM_dupallocN(con->data); - // NOTE: depreceated... old animation system - id_us_plus((ID *)con->ipo); - /* only do specific constraints if required */ if (cti) { /* perform custom copying operations if needed */ |