[Bf-blender-cvs] [24d1c352e8e] temp-geometry-nodes-fields-prototype: Make branch compile after recent multifunction network removal

Hans Goudey noreply at git.blender.org
Mon Aug 23 21:41:55 CEST 2021


Commit: 24d1c352e8e59139efa8a1cdefed13952f8c99ee
Author: Hans Goudey
Date:   Mon Aug 23 14:41:44 2021 -0500
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB24d1c352e8e59139efa8a1cdefed13952f8c99ee

Make branch compile after recent multifunction network removal

===================================================================

M	source/blender/editors/space_node/node_draw.cc
M	source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_noise.cc

===================================================================

diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index cca61148c85..8a313d6ff80 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -812,7 +812,7 @@ static bool use_special_non_field_socket_drawing(const bNodeTree *node_tree,
   if (socket->in_out == SOCK_OUT) {
     return false;
   }
-  if (node->typeinfo->expand_in_mf_network) {
+  if (node->typeinfo->build_multi_function) {
     /* Wow, that's hacky. Don't use vertical bar for function nodes. */
     return false;
   }
diff --git a/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc b/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
index fae61d67a48..7f72988344b 100644
--- a/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
+++ b/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
@@ -162,10 +162,10 @@ static const blender::fn::MultiFunction &get_multi_function(bNode &node)
   return fixed_pivot;
 }
 
-static void fn_node_align_rotation_to_vector_expand_in_mf_network(
-    blender::nodes::NodeMFNetworkBuilder &builder)
+static void fn_node_align_rotation_to_vector_build_multi_function(
+    blender::nodes::NodeMultiFunctionBuilder &builder)
 {
-  const blender::fn::MultiFunction &fn = get_multi_function(builder.bnode());
+  const blender::fn::MultiFunction &fn = get_multi_function(builder.node());
   builder.set_matching_fn(fn);
 }
 
@@ -185,7 +185,7 @@ void register_node_type_fn_align_rotation_to_vector()
                     "FunctionNodeAlignRotationToVector",
                     node_free_standard_storage,
                     node_copy_standard_storage);
-  ntype.expand_in_mf_network = fn_node_align_rotation_to_vector_expand_in_mf_network;
+  ntype.build_multi_function = fn_node_align_rotation_to_vector_build_multi_function;
   ntype.draw_buttons = fn_node_align_rotation_to_vector_layout;
   nodeRegisterType(&ntype);
 }
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 a9ff82f42ea..43515f0502f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
@@ -191,19 +191,17 @@ class NoiseTextureFunction1D : public blender::fn::MultiFunction {
   }
 };
 
-static void sh_node_tex_noise_expand_in_mf_network(blender::nodes::NodeMFNetworkBuilder &builder)
+static void sh_node_tex_noise_build_multi_function(
+    blender::nodes::NodeMultiFunctionBuilder &builder)
 {
   /* TODO: Not only support 1D and 3D. */
-  NodeTexNoise *tex = builder.dnode()->storage<NodeTexNoise>();
+  NodeTexNoise *tex = (NodeTexNoise *)builder.node().storage;
   if (tex->dimensions == 1) {
     builder.construct_and_set_matching_fn<NoiseTextureFunction1D>();
   }
   else if (tex->dimensions == 3) {
     builder.construct_and_set_matching_fn<NoiseTextureFunction3D>();
   }
-  else {
-    builder.set_not_implemented();
-  }
 }
 
 /* node type definition */
@@ -218,7 +216,7 @@ void register_node_type_sh_tex_noise(void)
       &ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage);
   node_type_gpu(&ntype, node_shader_gpu_tex_noise);
   node_type_update(&ntype, node_shader_update_tex_noise);
-  ntype.expand_in_mf_network = sh_node_tex_noise_expand_in_mf_network;
+  ntype.build_multi_function = sh_node_tex_noise_build_multi_function;
 
   nodeRegisterType(&ntype);
 }



More information about the Bf-blender-cvs mailing list