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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-08 20:30:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-08 20:30:35 +0300
commit1cf9493e242f92e32d0c1674b7d7f8cfb698ef96 (patch)
tree6248604c2502ccf778075f8ee3db9c04fefc28e8 /source/blender/blenkernel/intern
parenta53027eb0510f64eaa518444cdd1088e2378ee68 (diff)
run id_lib_extern on all constraint ID data when copying. solves possible errors when running make proxy on a library object.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/constraint.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 18bf824f8d3..4f4c1959f34 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -2011,14 +2011,6 @@ static void actcon_new_data (void *cdata)
data->type = 20;
}
-/* only for setting the ID as extern */
-static void actcon_copy_data (bConstraint *con, bConstraint *srccon)
-{
- //bActionConstraint *src= srccon->data;
- bActionConstraint *dst= con->data;
- id_lib_extern((ID *)dst->act); /* would be better solved with something like modifiers_foreachIDLink */
-}
-
static void actcon_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
{
bActionConstraint *data= con->data;
@@ -2170,7 +2162,7 @@ static bConstraintTypeInfo CTI_ACTION = {
NULL, /* free data */
actcon_relink, /* relink data */
actcon_id_looper, /* id looper */
- actcon_copy_data, /* copy data */
+ NULL, /* copy data */
actcon_new_data, /* new data */
actcon_get_tars, /* get constraint targets */
actcon_flush_tars, /* flush constraint targets */
@@ -4049,6 +4041,12 @@ void id_loop_constraints (ListBase *conlist, ConstraintIDFunc func, void *userda
/* ......... */
+static void con_extern_cb(bConstraint *con, ID **idpoin, void *userdata)
+{
+ if(idpoin && (*idpoin)->lib)
+ id_lib_extern(*idpoin);
+}
+
/* duplicate all of the constraints in a constraint stack */
void copy_constraints (ListBase *dst, const ListBase *src)
{
@@ -4067,8 +4065,15 @@ void copy_constraints (ListBase *dst, const ListBase *src)
id_us_plus((ID *)con->ipo);
/* only do specific constraints if required */
- if (cti && cti->copy_data)
- cti->copy_data(con, srccon);
+ if (cti) {
+ if (cti->copy_data) {
+ cti->copy_data(con, srccon);
+ }
+
+ if(cti->id_looper) {
+ cti->id_looper(con, con_extern_cb, NULL);
+ }
+ }
}
}