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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-10 17:23:59 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-10 17:23:59 +0300
commit1cc8f9d463a7cffbe5a466a4d83a8070a5b8d959 (patch)
tree2c44a01aae07f954edd5ad89b661e8b68d904c6a /source/blender/blenkernel/intern/library.c
parent81a7f6c84844a7eafc33711c1fb792e8e0bbc459 (diff)
Fix T62393: Materials made from 'Make Single User' have linked animation.
`id_single_user()` was still code from older ID management, now we can use modern code to handle animdata duplication for us (which allows to keep handling of nasty sub-data ID horrors like nodtrees in a single place, much safer and simpler).
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 2db67939d42..52796d06a3f 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -770,9 +770,8 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
/* if property isn't editable, we're going to have an extra block hanging around until we save */
if (RNA_property_editable(ptr, prop)) {
Main *bmain = CTX_data_main(C);
- if (BKE_id_copy(bmain, id, &newid) && newid) {
- /* copy animation actions too */
- BKE_animdata_copy_id_action(bmain, id, false);
+ /* copy animation actions too */
+ if (BKE_id_copy_ex(bmain, id, &newid, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS) && newid) {
/* us is 1 by convention with new IDs, but RNA_property_pointer_set
* will also increment it, decrement it here. */
id_us_min(newid);