From 3d91a853b209bc82296e40a65c2cb816e618ec70 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 28 Jul 2022 16:34:17 -0500 Subject: 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. --- source/blender/editors/space_node/node_group.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_node/node_group.cc') 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 ""; -- cgit v1.2.3 From 42ccbb7cd1d5c68ff0729f43dd3d89b6365b2411 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 29 Jul 2022 16:56:48 +0200 Subject: Cleanup: Move RNA path functions into own C++ file Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne --- source/blender/editors/space_node/node_group.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_node/node_group.cc') diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc index d69d326c481..bb520c0537e 100644 --- a/source/blender/editors/space_node/node_group.cc +++ b/source/blender/editors/space_node/node_group.cc @@ -36,6 +36,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_path.h" #include "RNA_prototypes.h" #include "WM_api.h" -- cgit v1.2.3