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!
This commit is contained in:
Bastien Montagne 2016-07-11 19:09:46 +02:00
parent 62ea383622
commit 439ccca1e0
1 changed files with 5 additions and 1 deletions

View File

@ -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 {