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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2022-01-09 08:59:34 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2022-01-09 08:59:34 +0300
commite17ac8dc58c7108cfb3a784a595912c063e09cf4 (patch)
tree3a0a30fce007550c2743e423dd5f5017a0ca7753 /source/blender/nodes/shader/nodes/node_shader_wireframe.cc
parented1ced24848824a4acbaaf7aa7ccb34441f6a8f4 (diff)
Cleanup: Nodes: Begin splitting shader node buttons into individual files
Currently, most node buttons are defined in `drawnode.cc` however, this is inconvenient because it requires editing many files when adding new nodes. The goal is to minimize the number of files needed to add or update a node. This commit moves most of the node layout functions for shader nodes into their respected source/blender/nodes/shader/nodes file. In the future, these functions will be simplified to node_layout. Some nodes were left in `drawnode.cc` as this would require duplicating code while this is likely fine it is best to leave that to a seperate commit.
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_wireframe.cc')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_wireframe.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_wireframe.cc b/source/blender/nodes/shader/nodes/node_shader_wireframe.cc
index a23887e9721..1ba2391a09d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_wireframe.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_wireframe.cc
@@ -19,6 +19,9 @@
#include "node_shader_util.hh"
+#include "UI_interface.h"
+#include "UI_resources.h"
+
namespace blender::nodes::node_shader_wireframe_cc {
static void node_declare(NodeDeclarationBuilder &b)
@@ -27,6 +30,11 @@ static void node_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Float>(N_("Fac"));
}
+static void node_shader_buts_wireframe(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "use_pixel_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
+}
+
static int node_shader_gpu_wireframe(GPUMaterial *mat,
bNode *node,
bNodeExecData *UNUSED(execdata),
@@ -60,6 +68,7 @@ void register_node_type_sh_wireframe()
sh_node_type_base(&ntype, SH_NODE_WIREFRAME, "Wireframe", NODE_CLASS_INPUT);
ntype.declare = file_ns::node_declare;
+ ntype.draw_buttons = file_ns::node_shader_buts_wireframe;
node_type_gpu(&ntype, file_ns::node_shader_gpu_wireframe);
nodeRegisterType(&ntype);