diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-09 08:59:34 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-09 08:59:34 +0300 |
commit | e17ac8dc58c7108cfb3a784a595912c063e09cf4 (patch) | |
tree | 3a0a30fce007550c2743e423dd5f5017a0ca7753 /source/blender/nodes/shader/nodes/node_shader_tex_noise.cc | |
parent | ed1ced24848824a4acbaaf7aa7ccb34441f6a8f4 (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_tex_noise.cc')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_noise.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index fe402675ec6..9e378ff0110 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -21,6 +21,9 @@ #include "BLI_noise.hh" +#include "UI_interface.h" +#include "UI_resources.h" + namespace blender::nodes::node_shader_tex_noise_cc { NODE_STORAGE_FUNCS(NodeTexNoise) @@ -45,6 +48,11 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b) b.add_output<decl::Color>(N_("Color")).no_muted_links(); }; +static void node_shader_buts_tex_noise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "noise_dimensions", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); +} + static void node_shader_init_tex_noise(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexNoise *tex = MEM_cnew<NodeTexNoise>(__func__); @@ -256,6 +264,7 @@ void register_node_type_sh_tex_noise() sh_fn_node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_noise_declare; + ntype.draw_buttons = file_ns::node_shader_buts_tex_noise; node_type_init(&ntype, file_ns::node_shader_init_tex_noise); node_type_storage( &ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage); |