diff options
author | Jacques Lucke <jacques@blender.org> | 2021-08-19 19:09:52 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-08-19 19:09:52 +0300 |
commit | 1ee80d792c4cbadcafb6b5587bb3f730e9c0a6b0 (patch) | |
tree | cac999ed199f202406fdebaae124e87b7d66b855 | |
parent | 95284d2f1edd65cd3ee279572ab80376d6d5fa9f (diff) |
cleanup
5 files changed, 21 insertions, 22 deletions
diff --git a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc index fa0efa26d7b..0ba9080918c 100644 --- a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc +++ b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc @@ -94,7 +94,7 @@ void register_node_type_fn_boolean_math() node_type_socket_templates(&ntype, fn_node_boolean_math_in, fn_node_boolean_math_out); node_type_label(&ntype, node_boolean_math_label); node_type_update(&ntype, node_boolean_math_update); - ntype.draw_buttons = fn_node_boolean_math_layout; ntype.build_multi_function = fn_node_boolean_math_build_multi_function; + ntype.draw_buttons = fn_node_boolean_math_layout; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/function/nodes/node_fn_float_compare.cc b/source/blender/nodes/function/nodes/node_fn_float_compare.cc index 53f505880af..16ffb761a15 100644 --- a/source/blender/nodes/function/nodes/node_fn_float_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_float_compare.cc @@ -113,7 +113,7 @@ void register_node_type_fn_float_compare() node_type_socket_templates(&ntype, fn_node_float_compare_in, fn_node_float_compare_out); node_type_label(&ntype, node_float_compare_label); node_type_update(&ntype, node_float_compare_update); - ntype.draw_buttons = geo_node_float_compare_layout; ntype.build_multi_function = fn_node_float_compare_build_multi_function; + ntype.draw_buttons = geo_node_float_compare_layout; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/function/nodes/node_fn_float_to_int.cc b/source/blender/nodes/function/nodes/node_fn_float_to_int.cc index 34008ed2ef6..52acfefe615 100644 --- a/source/blender/nodes/function/nodes/node_fn_float_to_int.cc +++ b/source/blender/nodes/function/nodes/node_fn_float_to_int.cc @@ -90,7 +90,7 @@ void register_node_type_fn_float_to_int() fn_node_type_base(&ntype, FN_NODE_FLOAT_TO_INT, "Float to Integer", NODE_CLASS_CONVERTOR, 0); node_type_socket_templates(&ntype, fn_node_float_to_int_in, fn_node_float_to_int_out); node_type_label(&ntype, node_float_to_int_label); - ntype.draw_buttons = fn_node_float_to_int_layout; ntype.build_multi_function = fn_node_float_to_int_build_multi_function; + ntype.draw_buttons = fn_node_float_to_int_layout; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/function/nodes/node_fn_input_string.cc b/source/blender/nodes/function/nodes/node_fn_input_string.cc index e25ff31715a..560ace57aba 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_string.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_string.cc @@ -29,6 +29,16 @@ static void fn_node_input_string_layout(uiLayout *layout, bContext *UNUSED(C), P uiItemR(layout, ptr, "string", 0, "", ICON_NONE); } +static void fn_node_input_string_build_multi_function( + blender::nodes::NodeMultiFunctionBuilder &builder) +{ + bNode &bnode = builder.node(); + NodeInputString *node_storage = static_cast<NodeInputString *>(bnode.storage); + std::string string = std::string((node_storage->string) ? node_storage->string : ""); + builder.construct_and_set_matching_fn<blender::fn::CustomMF_Constant<std::string>>( + std::move(string)); +} + static void fn_node_input_string_init(bNodeTree *UNUSED(ntree), bNode *node) { node->storage = MEM_callocN(sizeof(NodeInputString), __func__); @@ -60,16 +70,6 @@ static void fn_node_string_copy(bNodeTree *UNUSED(dest_ntree), dest_node->storage = destination_storage; } -static void fn_node_input_string_build_multi_function( - blender::nodes::NodeMultiFunctionBuilder &builder) -{ - bNode &bnode = builder.node(); - NodeInputString *node_storage = static_cast<NodeInputString *>(bnode.storage); - std::string string = std::string((node_storage->string) ? node_storage->string : ""); - builder.construct_and_set_matching_fn<blender::fn::CustomMF_Constant<std::string>>( - std::move(string)); -} - void register_node_type_fn_input_string() { static bNodeType ntype; @@ -78,7 +78,7 @@ void register_node_type_fn_input_string() node_type_socket_templates(&ntype, nullptr, fn_node_input_string_out); node_type_init(&ntype, fn_node_input_string_init); node_type_storage(&ntype, "NodeInputString", fn_node_input_string_free, fn_node_string_copy); - ntype.draw_buttons = fn_node_input_string_layout; ntype.build_multi_function = fn_node_input_string_build_multi_function; + ntype.draw_buttons = fn_node_input_string_layout; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/function/nodes/node_fn_input_vector.cc b/source/blender/nodes/function/nodes/node_fn_input_vector.cc index 58a0e29fa05..244c045de9a 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_vector.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_vector.cc @@ -32,13 +32,6 @@ static void fn_node_input_vector_layout(uiLayout *layout, bContext *UNUSED(C), P uiItemR(col, ptr, "vector", UI_ITEM_R_EXPAND, "", ICON_NONE); } -static void fn_node_input_vector_init(bNodeTree *UNUSED(ntree), bNode *node) -{ - NodeInputVector *data = (NodeInputVector *)MEM_callocN(sizeof(NodeInputVector), - "input vector node"); - node->storage = data; -} - static void fn_node_vector_input_build_multi_function( blender::nodes::NodeMultiFunctionBuilder &builder) { @@ -47,6 +40,12 @@ static void fn_node_vector_input_build_multi_function( blender::float3 vector(node_storage->vector); builder.construct_and_set_matching_fn<blender::fn::CustomMF_Constant<blender::float3>>(vector); } +static void fn_node_input_vector_init(bNodeTree *UNUSED(ntree), bNode *node) +{ + NodeInputVector *data = (NodeInputVector *)MEM_callocN(sizeof(NodeInputVector), + "input vector node"); + node->storage = data; +} void register_node_type_fn_input_vector() { @@ -57,7 +56,7 @@ void register_node_type_fn_input_vector() node_type_init(&ntype, fn_node_input_vector_init); node_type_storage( &ntype, "NodeInputVector", node_free_standard_storage, node_copy_standard_storage); - ntype.draw_buttons = fn_node_input_vector_layout; ntype.build_multi_function = fn_node_vector_input_build_multi_function; + ntype.draw_buttons = fn_node_input_vector_layout; nodeRegisterType(&ntype); } |