diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-11 20:09:46 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-11 22:30:02 +0300 |
commit | 439ccca1e0b7078f3055ec14a7c81e964594ae6b (patch) | |
tree | da408560ee0fb5963eee1ed5bd496b571ce3e019 /source | |
parent | 62ea383622d8cb9ae284217bd040d93a6d123859 (diff) |
Add an exception/hack to new BKE_id_expand_local(), to ignore actions datablock in its usercount handling.
Reason is, typically those actions datablock usercounts have already been adjusted in BKE_animdata_copy()
(called by generic iddata copy function).
Think this needs to be reworked a bit too, there are way too much ways to copy animdata currently,
it's rather confusing. But not the goal here, so for now we'll live with the hack!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index fc584e172a1..678ac662ae3 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -257,7 +257,11 @@ static int id_expand_local_callback(void *user_data, struct ID *UNUSED(id_self), /* We tag all ID usages as extern, and increase usercount in case it was requested. */ if (*id_pointer) { - if (do_user_count && (cd_flag & IDWALK_USER)) { + if (do_user_count && (cd_flag & IDWALK_USER) && + /* XXX This is a hack - animdata copying needs a good check and cleanup, it's done with way too much + * various functions currently, so for now we assume actions' usercount is already handled here... */ + (GS((*id_pointer)->name) != ID_AC)) + { id_us_plus(*id_pointer); } else { |