From f4af21038d82bba525dec4bfd291c43504607acf Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 10 Jan 2022 16:41:05 -0600 Subject: Geometry Nodes: Move normal field input to be usable elsewhere This commit moves the normal field input to `BKE_geometry_set.hh` from the node file so that normals can be used as an implicit input to other nodes. Differential Revision: https://developer.blender.org/D13779 --- source/blender/blenkernel/BKE_geometry_set.hh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/blender/blenkernel/BKE_geometry_set.hh') diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index a429aecd828..acb89637f20 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -1078,6 +1078,30 @@ class IDAttributeFieldInput : public GeometryFieldInput { bool is_equal_to(const fn::FieldNode &other) const override; }; +VArray curve_normals_varray(const CurveComponent &component, const AttributeDomain domain); + +VArray mesh_normals_varray(const MeshComponent &mesh_component, + const Mesh &mesh, + const IndexMask mask, + const AttributeDomain domain); + +class NormalFieldInput : public GeometryFieldInput { + public: + NormalFieldInput() : GeometryFieldInput(CPPType::get()) + { + category_ = Category::Generated; + } + + GVArray get_varray_for_context(const GeometryComponent &component, + const AttributeDomain domain, + IndexMask mask) const override; + + std::string socket_inspection_name() const override; + + uint64_t hash() const override; + bool is_equal_to(const fn::FieldNode &other) const override; +}; + class AnonymousAttributeFieldInput : public GeometryFieldInput { private: /** -- cgit v1.2.3