From 82a46ea6f8829fc40205d0d3cabf4017eb738d9a Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 30 Aug 2022 11:08:27 -0500 Subject: Geometry Nodes: Use separate field context for each geometry type Using the same `GeometryComponentFieldContext` for all situations, even when only one geometry type is supported is misleading, and mixes too many different abstraction levels into code that could be simpler. With the attribute API moved out of geometry components recently, the "component" system is just getting in the way here. This commit adds specific field contexts for geometry types: meshes, curves, point clouds, and instances. There are also separate field input helper classes, to help reduce boilerplate for fields that only support specific geometry types. Another benefit of this change is that it separates geometry components from fields, which makes it easier to see the purpose of the two concepts, and how they relate. Because we want to be able to evaluate a field on just `CurvesGeometry` rather than the full `Curves` data-block, the generic "geometry context" had to be changed to avoid using `GeometryComponent`, since there is no corresponding geometry component type. The resulting void pointer is ugly, but only turns up in three places in practice. When Apple clang supports `std::variant`, that could be used instead. Differential Revision: https://developer.blender.org/D15519 --- source/blender/blenkernel/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenkernel/CMakeLists.txt') diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 8b7fbc4938f..465573745ec 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -143,6 +143,7 @@ set(SRC intern/geometry_component_mesh.cc intern/geometry_component_pointcloud.cc intern/geometry_component_volume.cc + intern/geometry_fields.cc intern/geometry_set.cc intern/geometry_set_instances.cc intern/gpencil.c -- cgit v1.2.3