From d3ad04172de2b928aeb561b74a58996586b1db1c Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Mon, 3 Jan 2022 19:32:33 -0500 Subject: 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 --- source/blender/nodes/intern/node_common.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/nodes/intern/node_common.cc') 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("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("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("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("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); -- cgit v1.2.3