Blender Git Loki

Git Commits -> Revision bf47fb4

Revision bf47fb4 by Jacques Lucke (master)
September 9, 2021, 10:54 (GMT)
Geometry Nodes: fields and anonymous attributes

This implements the initial core framework for fields and anonymous
attributes (also see T91274).

The new functionality is hidden behind the "Geometry Nodes Fields"
feature flag. When enabled in the user preferences, the following
new nodes become available: `Position`, `Index`, `Normal`,
`Set Position` and `Attribute Capture`.

Socket inspection has not been updated to work with fields yet.

Besides these changes at the user level, this patch contains the
ground work for:
* building and evaluating fields at run-time (`FN_fields.hh`) and
* creating and accessing anonymous attributes on geometry
(`BKE_anonymous_attribute.h`).

For evaluating fields we use a new so called multi-function procedure
(`FN_multi_function_procedure.hh`). It allows composing multi-functions
in arbitrary ways and supports efficient evaluation as is required by
fields. See `FN_multi_function_procedure.hh` for more details on how
this evaluation mechanism can be used.

A new `AttributeIDRef` has been added which allows handling named
and anonymous attributes in the same way in many places.

Hans and I worked on this patch together.

Differential Revision: https://developer.blender.org/D12414

Commit Details:

Full Hash: bf47fb40fd6f0ee9386e9936cf213a1049c55b61
Parent Commit: 0f6be4e
Lines Changed: +6674, -468

19 Added Paths:

/source/blender/blenkernel/BKE_anonymous_attribute.h (+43, -0) (View)
/source/blender/blenkernel/BKE_anonymous_attribute.hh (+169, -0) (View)
/source/blender/blenkernel/intern/anonymous_attribute.cc (+118, -0) (View)
/source/blender/functions/FN_field.hh (+456, -0) (View)
/source/blender/functions/FN_field_cpp_type.hh (+72, -0) (View)
/source/blender/functions/FN_multi_function_procedure.hh (+452, -0) (View)
/source/blender/functions/FN_multi_function_procedure_builder.hh (+260, -0) (View)
/source/blender/functions/FN_multi_function_procedure_executor.hh (+39, -0) (View)
/source/blender/functions/intern/field.cc (+569, -0) (View)
/source/blender/functions/intern/multi_function_procedure.cc (+794, -0) (View)
/source/blender/functions/intern/multi_function_procedure_builder.cc (+175, -0) (View)
/source/blender/functions/intern/multi_function_procedure_executor.cc (+1212, -0) (View)
/source/blender/functions/tests/FN_field_test.cc (+278, -0) (View)
/source/blender/functions/tests/FN_multi_function_procedure_test.cc (+344, -0) (View)
/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc (+210, -0) (View)
/source/blender/nodes/geometry/nodes/node_geo_input_index.cc (+60, -0) (View)
/source/blender/nodes/geometry/nodes/node_geo_input_normal.cc (+211, -0) (View)
/source/blender/nodes/geometry/nodes/node_geo_input_position.cc (+43, -0) (View)
/source/blender/nodes/geometry/nodes/node_geo_set_position.cc (+79, -0) (View)

48 Modified Paths:

/release/scripts/startup/bl_ui/space_userpref.py (+1, -0) (Diff)
/release/scripts/startup/nodeitems_builtins.py (+9, -0) (Diff)
/source/blender/blenkernel/BKE_attribute_access.hh (+88, -10) (Diff)
/source/blender/blenkernel/BKE_customdata.h (+12, -0) (Diff)
/source/blender/blenkernel/BKE_geometry_set.hh (+93, -21) (Diff)
/source/blender/blenkernel/BKE_geometry_set_instances.hh (+5, -4) (Diff)
/source/blender/blenkernel/BKE_node.h (+5, -0) (Diff)
/source/blender/blenkernel/CMakeLists.txt (+3, -0) (Diff)
/source/blender/blenkernel/intern/attribute_access.cc (+278, -144) (Diff)
/source/blender/blenkernel/intern/attribute_access_intern.hh (+12, -11) (Diff)
/source/blender/blenkernel/intern/curve_eval.cc (+5, -3) (Diff)
/source/blender/blenkernel/intern/customdata.c (+52, -1) (Diff)
/source/blender/blenkernel/intern/geometry_component_curve.cc (+12, -12) (Diff)
/source/blender/blenkernel/intern/geometry_component_mesh.cc (+18, -6) (Diff)
/source/blender/blenkernel/intern/geometry_set_instances.cc (+27, -26) (Diff)
/source/blender/blenkernel/intern/node.cc (+5, -0) (Diff)
/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc (+14, -9) (Diff)
/source/blender/functions/CMakeLists.txt (+11, -0) (Diff)
/source/blender/functions/FN_multi_function_builder.hh (+9, -0) (Diff)
/source/blender/functions/FN_multi_function_params.hh (+1, -1) (Diff)
/source/blender/functions/intern/cpp_types.cc (+9, -0) (Diff)
/source/blender/functions/intern/multi_function_builder.cc (+28, -0) (Diff)
/source/blender/makesdna/DNA_customdata_types.h (+9, -0) (Diff)
/source/blender/makesdna/DNA_node_types.h (+7, -0) (Diff)
/source/blender/makesdna/DNA_userdef_types.h (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+20, -0) (Diff)
/source/blender/makesrna/intern/rna_userdef.c (+4, -0) (Diff)
/source/blender/modifiers/intern/MOD_nodes.cc (+15, -6) (Diff)
/source/blender/modifiers/intern/MOD_nodes_evaluator.cc (+42, -21) (Diff)
/source/blender/nodes/CMakeLists.txt (+5, -0) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_endpoints.cc (+26, -25) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc (+8, -8) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc (+2, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc (+4, -4) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_subdivide.cc (+4, -4) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc (+42, -40) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc (+8, -8) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc (+4, -4) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc (+46, -44) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc (+11, -10) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc (+8, -8) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_point_separate.cc (+3, -3) (Diff)
/source/blender/nodes/geometry/node_geometry_util.hh (+1, -1) (Diff)
/source/blender/nodes/intern/geometry_nodes_eval_log.cc (+4, -2) (Diff)
/source/blender/nodes/intern/node_socket.cc (+51, -12) (Diff)
/source/blender/nodes/NOD_geometry.h (+5, -0) (Diff)
/source/blender/nodes/NOD_geometry_exec.hh (+56, -16) (Diff)
/source/blender/nodes/NOD_static_types.h (+6, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021