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-30 18:37:39 +0300
committerHans Goudey <h.goudey@me.com>2022-03-30 18:37:39 +0300
commit60a6fbf5b59911cba54d30bd1105626fcc577875 (patch)
treeaa7dbda40335765f75ebc1112a0ad8176dd3eaef /source/blender/nodes/geometry/node_geometry_util.hh
parentba28c10199b363df469cf70f2e9436be90deb258 (diff)
Curves: Port resample node to the new data-block
This commit re-implements the resample curve node to use the new curves type instead of CurveEval. The largest changes come from the need to keep track of offsets into the point attribute arrays, and the fact that the attributes for all curves are stored in a flat array. Another difference is that a bit more of the logic is handled by building of the field network inputs. The idea is to let the field evaluator handle potential optimizations while making the rest of the code simpler. When resampling 1 million small poly curves,the node is about 6 times faster compared to 3.1 on my hardware (500ms to 80ms). This also adds support for Catmull Rom curve inputs. Differential Revision: https://developer.blender.org/D14435
Diffstat (limited to 'source/blender/nodes/geometry/node_geometry_util.hh')
-rw-r--r--source/blender/nodes/geometry/node_geometry_util.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh
index 5b7211e44b4..7af3159bbf8 100644
--- a/source/blender/nodes/geometry/node_geometry_util.hh
+++ b/source/blender/nodes/geometry/node_geometry_util.hh
@@ -81,4 +81,14 @@ void separate_geometry(GeometrySet &geometry_set,
std::optional<CustomDataType> node_data_type_to_custom_data_type(eNodeSocketDatatype type);
std::optional<CustomDataType> node_socket_to_custom_data_type(const bNodeSocket &socket);
+class SplineLengthFieldInput final : public GeometryFieldInput {
+ public:
+ SplineLengthFieldInput();
+ GVArray get_varray_for_context(const GeometryComponent &component,
+ AttributeDomain domain,
+ IndexMask mask) const final;
+ uint64_t hash() const override;
+ bool is_equal_to(const fn::FieldNode &other) const override;
+};
+
} // namespace blender::nodes