[Bf-blender-cvs] [7e3e4751b54] master: UI: Fix count on node editor/group header when fake user
Dalai Felinto
noreply at git.blender.org
Tue Oct 25 10:17:27 CEST 2022
Commit: 7e3e4751b544bce290288de4af8651847d230655
Author: Dalai Felinto
Date: Tue Oct 25 10:15:24 2022 +0200
Branches: master
https://developer.blender.org/rB7e3e4751b544bce290288de4af8651847d230655
UI: Fix count on node editor/group header when fake user
The number of node groups was including the fake user count.
I was ignoring the Fake User, and how it affects the id->us count.
This problem was present since the initial commit: 84825e4ed2e09895.
===================================================================
M source/blender/editors/interface/interface_context_path.cc
M source/blender/editors/space_node/node_draw.cc
===================================================================
diff --git a/source/blender/editors/interface/interface_context_path.cc b/source/blender/editors/interface/interface_context_path.cc
index 91b2f9613de..74a07d6edc8 100644
--- a/source/blender/editors/interface/interface_context_path.cc
+++ b/source/blender/editors/interface/interface_context_path.cc
@@ -45,7 +45,7 @@ void context_path_add_generic(Vector<ContextPathItem> &path,
if (&rna_type == &RNA_NodeTree) {
ID *id = (ID *)ptr;
- path.append({name, int(icon), id->us});
+ path.append({name, int(icon), ID_REAL_USERS(id)});
}
else {
path.append({name, int(icon), 1});
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 98b2cacd162..5ae6573df7c 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -2146,7 +2146,7 @@ static void node_draw_basis(const bContext &C,
"");
UI_but_func_set(but, node_toggle_button_cb, &node, (void *)"NODE_OT_group_edit");
if (node.id) {
- UI_but_icon_indicator_number_set(but, node.id->us);
+ UI_but_icon_indicator_number_set(but, ID_REAL_USERS(node.id));
}
UI_block_emboss_set(&block, UI_EMBOSS);
}
More information about the Bf-blender-cvs
mailing list