Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-03-16 16:51:11 +0300
committerHans Goudey <h.goudey@me.com>2022-03-16 16:51:11 +0300
commit943b919fe807b53558631bcbc688c2d712d6b0cc (patch)
treec1c141866f50eb1f28e1875195395c8582898cc2 /source/blender/nodes/function
parentcb267cec5552c17092a99999e4e352bf266b578f (diff)
Geometry Nodes: Remove legacy node code
This commit removes the implementations of legacy nodes, their type definitions, and related code that becomes unused. Now that we have two releases that included the legacy nodes, there is not much reason to include them still. Removing the code means refactoring will be easier, and old code doesn't have to be tested and maintained. After this commit, the legacy nodes will be undefined in the UI, so 3.0 or 3.1 should be used to convert files to the fields system. The net change is 12184 lines removed! The tooltip for legacy nodes mentioned that we would remove them before 4.0, which was purposefully a bit vague to allow us this flexibility. In a poll in a devtalk post showed that the majority of people were okay with removing the nodes. https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199 Differential Revision: https://developer.blender.org/D14353
Diffstat (limited to 'source/blender/nodes/function')
-rw-r--r--source/blender/nodes/function/CMakeLists.txt2
-rw-r--r--source/blender/nodes/function/nodes/legacy/node_fn_random_float.cc74
2 files changed, 0 insertions, 76 deletions
diff --git a/source/blender/nodes/function/CMakeLists.txt b/source/blender/nodes/function/CMakeLists.txt
index 7ffc5c71b66..6ccc4c7bf5c 100644
--- a/source/blender/nodes/function/CMakeLists.txt
+++ b/source/blender/nodes/function/CMakeLists.txt
@@ -18,8 +18,6 @@ set(INC
set(SRC
- nodes/legacy/node_fn_random_float.cc
-
nodes/node_fn_align_euler_to_vector.cc
nodes/node_fn_boolean_math.cc
nodes/node_fn_compare.cc
diff --git a/source/blender/nodes/function/nodes/legacy/node_fn_random_float.cc b/source/blender/nodes/function/nodes/legacy/node_fn_random_float.cc
deleted file mode 100644
index a34cfe578d0..00000000000
--- a/source/blender/nodes/function/nodes/legacy/node_fn_random_float.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-
-#include "node_function_util.hh"
-
-#include "BLI_hash.h"
-
-namespace blender::nodes::node_fn_random_float_cc {
-
-static void fn_node_legacy_random_float_declare(NodeDeclarationBuilder &b)
-{
- b.is_function_node();
- b.add_input<decl::Float>(N_("Min")).min(-10000.0f).max(10000.0f);
- b.add_input<decl::Float>(N_("Max")).default_value(1.0f).min(-10000.0f).max(10000.0f);
- b.add_input<decl::Int>(N_("Seed")).min(-10000).max(10000);
- b.add_output<decl::Float>(N_("Value"));
-}
-
-class RandomFloatFunction : public blender::fn::MultiFunction {
- public:
- RandomFloatFunction()
- {
- static blender::fn::MFSignature signature = create_signature();
- this->set_signature(&signature);
- }
-
- static blender::fn::MFSignature create_signature()
- {
- blender::fn::MFSignatureBuilder signature{"Random float"};
- signature.single_input<float>("Min");
- signature.single_input<float>("Max");
- signature.single_input<int>("Seed");
- signature.single_output<float>("Value");
- return signature.build();
- }
-
- void call(blender::IndexMask mask,
- blender::fn::MFParams params,
- blender::fn::MFContext UNUSED(context)) const override
- {
- const blender::VArray<float> &min_values = params.readonly_single_input<float>(0, "Min");
- const blender::VArray<float> &max_values = params.readonly_single_input<float>(1, "Max");
- const blender::VArray<int> &seeds = params.readonly_single_input<int>(2, "Seed");
- blender::MutableSpan<float> values = params.uninitialized_single_output<float>(3, "Value");
-
- for (int64_t i : mask) {
- const float min_value = min_values[i];
- const float max_value = max_values[i];
- const int seed = seeds[i];
- const float value = BLI_hash_int_01(static_cast<uint32_t>(seed));
- values[i] = value * (max_value - min_value) + min_value;
- }
- }
-};
-
-static void fn_node_legacy_random_float_build_multi_function(
- blender::nodes::NodeMultiFunctionBuilder &builder)
-{
- static RandomFloatFunction fn;
- builder.set_matching_fn(fn);
-}
-
-} // namespace blender::nodes::node_fn_random_float_cc
-
-void register_node_type_fn_legacy_random_float()
-{
- namespace file_ns = blender::nodes::node_fn_random_float_cc;
-
- static bNodeType ntype;
-
- fn_node_type_base(&ntype, FN_NODE_LEGACY_RANDOM_FLOAT, "Random Float", 0);
- ntype.declare = file_ns::fn_node_legacy_random_float_declare;
- ntype.build_multi_function = file_ns::fn_node_legacy_random_float_build_multi_function;
- nodeRegisterType(&ntype);
-}