diff options
author | Aaron Carlisle <Blendify> | 2022-01-04 03:32:33 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-04 03:33:14 +0300 |
commit | d3ad04172de2b928aeb561b74a58996586b1db1c (patch) | |
tree | 31c38b7b942d0295ee9b1f9f083c19f98036d71a /source/blender/nodes/intern/node_common.cc | |
parent | 9793bc30cec959cce7a23d3b75a772f39cc3d721 (diff) |
Cleanup: Remove bNodeType flag from base registration functions
This flag is only used a few small cases, so instead
of setting the flag for every node only set the
required flag for the nodes that require it.
Mostly the flag is used to set `ntype.flag = NODE_PREVIEW`
For nodes that should have previews by default which
is only some compositor nodes and some texture nodes.
The frame node also sets the `NODE_BACKGROUND` flag.
All other nodes were setting a flag of 0 which has no purpose.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13699
Diffstat (limited to 'source/blender/nodes/intern/node_common.cc')
-rw-r--r-- | source/blender/nodes/intern/node_common.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index 99bcdcbbba8..1c9a1730635 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -238,10 +238,11 @@ void register_node_type_frame() bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); ntype->free_self = (void (*)(bNodeType *))MEM_freeN; - node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND); + node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT); node_type_init(ntype, node_frame_init); node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); node_type_size(ntype, 150, 100, 0); + ntype->flag |= NODE_BACKGROUND; nodeRegisterType(ntype); } @@ -267,7 +268,7 @@ void register_node_type_reroute() bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); ntype->free_self = (void (*)(bNodeType *))MEM_freeN; - node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT, 0); + node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT); node_type_init(ntype, node_reroute_init); nodeRegisterType(ntype); @@ -508,7 +509,7 @@ void register_node_type_group_input() bNodeType *ntype = MEM_cnew<bNodeType>("node type"); ntype->free_self = (void (*)(bNodeType *))MEM_freeN; - node_type_base(ntype, NODE_GROUP_INPUT, "Group Input", NODE_CLASS_INTERFACE, 0); + node_type_base(ntype, NODE_GROUP_INPUT, "Group Input", NODE_CLASS_INTERFACE); node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_input_init); node_type_update(ntype, node_group_input_update); @@ -606,7 +607,7 @@ void register_node_type_group_output() bNodeType *ntype = MEM_cnew<bNodeType>("node type"); ntype->free_self = (void (*)(bNodeType *))MEM_freeN; - node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE, 0); + node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE); node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_output_init); node_type_update(ntype, node_group_output_update); |