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')
-rw-r--r--source/blender/editors/include/ED_object.h12
-rw-r--r--source/blender/editors/object/object_constraint.c28
2 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 282df25172f..fcf18f306e1 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -346,6 +346,18 @@ void ED_object_constraint_dependency_tag_update(struct Main *bmain,
bool ED_object_constraint_move_to_index(struct Object *ob,
struct bConstraint *con,
const int index);
+void ED_object_constraint_link(struct Main *bmain,
+ struct Object *ob_dst,
+ struct ListBase *dst,
+ struct ListBase *src);
+void ED_object_constraint_copy_for_object(struct Main *bmain,
+ struct Object *ob_dst,
+ struct bConstraint *con);
+void ED_object_constraint_copy_for_pose(struct Main *bmain,
+ struct Object *ob_dst,
+ struct bPoseChannel *pchan,
+ struct bConstraint *con);
+
/* object_modes.c */
bool ED_object_mode_compat_test(const struct Object *ob, eObjectMode mode);
bool ED_object_mode_compat_set(struct bContext *C,
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index f0a320e42cf..b062ae0c698 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1436,6 +1436,34 @@ bool ED_object_constraint_move_to_index(Object *ob, bConstraint *con, const int
return true;
}
+
+void ED_object_constraint_link(Main *bmain, Object *ob_dst, ListBase *dst, ListBase *src)
+{
+ BKE_constraints_free(dst);
+ BKE_constraints_copy(dst, src, true);
+ LISTBASE_FOREACH (bConstraint *, con, dst) {
+ ED_object_constraint_dependency_tag_update(bmain, ob_dst, con);
+ }
+ WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, NULL);
+}
+
+void ED_object_constraint_copy_for_object(Main *bmain, Object *ob_dst, bConstraint *con)
+{
+ BKE_constraint_copy_for_object(ob_dst, con);
+ ED_object_constraint_dependency_tag_update(bmain, ob_dst, con);
+ WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, ob_dst);
+}
+
+void ED_object_constraint_copy_for_pose(Main *bmain,
+ Object *ob_dst,
+ bPoseChannel *pchan,
+ bConstraint *con)
+{
+ BKE_constraint_copy_for_pose(ob_dst, pchan, con);
+ ED_object_constraint_dependency_tag_update(bmain, ob_dst, con);
+ WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, ob_dst);
+}
+
/** \} */
/* ------------------------------------------------------------------- */