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>2015-10-08 12:29:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-08 12:29:49 +0300
commit97b6948181df4ee97296ec45aebc75f31b7c790a (patch)
treef2dbe2c2ba99abb1a0ee832268bb97d6fd4a4a22 /source/blender/blenkernel/intern/library_query.c
parent5eb500f2fce12f0b9a042480d0d4bf5000907726 (diff)
Fix T46386: Duplicate fails updating driver links
Duplicate wasn't updating links, so duplicatinvg a objects would still point to the originals for curve-taper, texmesh, drivers. Use generic id-looper to handle replacing data.
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r--source/blender/blenkernel/intern/library_query.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 4e78c7b5049..b59d0cf5b6d 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -62,6 +62,7 @@
#include "BKE_animsys.h"
#include "BKE_constraint.h"
#include "BKE_fcurve.h"
+#include "BKE_library.h"
#include "BKE_library_query.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
@@ -534,3 +535,19 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u
#undef FOREACH_CALLBACK_INVOKE_ID
#undef FOREACH_CALLBACK_INVOKE
+
+/**
+ * re-usable function, use when replacing ID's
+ */
+void BKE_library_update_ID_link_user(ID *id_dst, ID *id_src, const int cd_flag)
+{
+ if (cd_flag & IDWALK_USER) {
+ id_us_min(id_src);
+ id_us_plus(id_dst);
+ }
+ else if (cd_flag & IDWALK_USER_ONE) {
+ if (id_dst->us == 0) {
+ id_us_plus(id_dst);
+ }
+ }
+} \ No newline at end of file