Fix T75680: Nodegroup user count increased when file saved in edit group mode.

This editor's code was a bit schizophrenic, some parts considering its
nodetree usages as real refcounted ones, others, as shallow 'user one'
ones...

Editors should not be real ID users anyway, unless there are *very* good
reasons for it, so swich it to fully 'shallow' usage now.
This commit is contained in:
Bastien Montagne 2020-04-16 17:05:58 +02:00
parent 2a68b41b7d
commit e9bf624a49
Notes: blender-bot 2023-02-14 10:21:10 +01:00
Referenced by issue #75680, Nodegroup user count increased when file saved in edit group mode
2 changed files with 6 additions and 6 deletions

View File

@ -492,16 +492,17 @@ static void library_foreach_screen_area(LibraryForeachIDData *data, ScrArea *are
FOREACH_CALLBACK_INVOKE_ID(data, snode->from, IDWALK_CB_NOP);
FOREACH_CALLBACK_INVOKE(
data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER);
data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER_ONE);
for (path = snode->treepath.first; path; path = path->next) {
if (path == snode->treepath.first) {
/* first nodetree in path is same as snode->nodetree */
FOREACH_CALLBACK_INVOKE(
data, path->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_NOP);
FOREACH_CALLBACK_INVOKE(data,
path->nodetree,
is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER_ONE);
}
else {
FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER);
FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER_ONE);
}
if (path->nodetree == NULL) {

View File

@ -890,8 +890,7 @@ static void node_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, I
for (path = snode->treepath.first; path; path = path->next) {
if ((ID *)path->nodetree == old_id) {
path->nodetree = (bNodeTree *)new_id;
id_us_min(old_id);
id_us_plus(new_id);
id_us_ensure_real(new_id);
}
if (path == snode->treepath.first) {
/* first nodetree in path is same as snode->nodetree */