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:
authorHans Goudey <h.goudey@me.com>2022-07-29 00:34:17 +0300
committerHans Goudey <h.goudey@me.com>2022-07-29 00:34:17 +0300
commit3d91a853b209bc82296e40a65c2cb816e618ec70 (patch)
tree2a321be0ae2614dde2a192bb88c188fe4d742eca /source/blender/editors
parent4757a5ad338bbb1673ea89fa238069578a05be95 (diff)
Cleanup: Nodes: Store node group idname in tree type
There was already a utility to retrieve the correct node group idname from the context, `node_group_idname`, but often it's clearer to use lower-level arguments, or the context isn't accessible. Storing the group idname in the tree type makes it accessible without rewriting it elsewhere.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_node/node_group.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc
index 160a379d3c6..d69d326c481 100644
--- a/source/blender/editors/space_node/node_group.cc
+++ b/source/blender/editors/space_node/node_group.cc
@@ -44,7 +44,12 @@
#include "UI_resources.h"
#include "NOD_common.h"
+#include "NOD_composite.h"
+#include "NOD_geometry.h"
+#include "NOD_shader.h"
#include "NOD_socket.h"
+#include "NOD_texture.h"
+
#include "node_intern.hh" /* own include */
namespace blender::ed::space_node {
@@ -99,16 +104,16 @@ const char *node_group_idname(bContext *C)
SpaceNode *snode = CTX_wm_space_node(C);
if (ED_node_is_shader(snode)) {
- return "ShaderNodeGroup";
+ return ntreeType_Shader->group_idname;
}
if (ED_node_is_compositor(snode)) {
- return "CompositorNodeGroup";
+ return ntreeType_Composite->group_idname;
}
if (ED_node_is_texture(snode)) {
- return "TextureNodeGroup";
+ return ntreeType_Texture->group_idname;
}
if (ED_node_is_geometry(snode)) {
- return "GeometryNodeGroup";
+ return ntreeType_Geometry->group_idname;
}
return "";