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:
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_constraint.h1
-rw-r--r--source/blender/blenkernel/intern/constraint.c23
2 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 42089e37d63..9c5e89bff76 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -136,6 +136,7 @@ struct bConstraint *add_pose_constraint(struct Object *ob, struct bPoseChannel *
int remove_constraint(ListBase *list, struct bConstraint *con);
int remove_constraint_index(ListBase *list, int index);
+void remove_constraints_type(ListBase *list, short type, short last_only);
/* Constraints + Proxies function prototypes */
void extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
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 */