diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh index c859c83bda4..8e52a81a24a 100644 --- a/source/blender/nodes/NOD_geometry_exec.hh +++ b/source/blender/nodes/NOD_geometry_exec.hh @@ -8,6 +8,7 @@ #include "BLI_math_quaternion_types.hh" #include "FN_field.hh" +#include "FN_field_cpp_type.hh" #include "FN_lazy_function.hh" #include "FN_multi_function_builder.hh" @@ -104,6 +105,14 @@ class GeoNodeExecParams { identifier); return value_or_field.as_field(); } + else if constexpr (std::is_same_v, GField>) { + const int index = this->get_input_index(identifier); + const bNodeSocket &input_socket = node_.input_by_identifier(identifier); + const CPPType &value_type = *input_socket.typeinfo->geometry_nodes_cpp_type; + const fn::ValueOrFieldCPPType &value_or_field_type = *fn::ValueOrFieldCPPType::get_from_self( + value_type); + return value_or_field_type.as_field(params_.try_get_input_data_ptr(index)); + } else { #ifdef DEBUG this->check_input_access(identifier, &CPPType::get()); diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index e360a40f644..65007b0364c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -419,7 +419,7 @@ static void node_geo_exec(GeoNodeExecParams params) using T = decltype(dummy); if constexpr (is_same_any_v) { const std::string suffix = " " + identifier_suffix(); - Field input_field = params.extract_input>("Value" + suffix); + GField input_field = params.extract_input("Value" + suffix); if (params.output_is_required("Leading" + suffix)) { params.set_output( "Leading" + suffix, diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc index 1d294a01751..3e6c77b9d7d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc @@ -199,22 +199,22 @@ static void node_geo_exec(GeoNodeExecParams params) switch (data_type) { case CD_PROP_FLOAT: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; case CD_PROP_FLOAT3: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; case CD_PROP_COLOR: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; case CD_PROP_BOOL: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; case CD_PROP_INT32: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; case CD_PROP_QUATERNION: - field = params.get_input>(input_identifier); + field = params.extract_input(input_identifier); break; default: break; diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc index bc69e324a09..92d4f5115f5 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc @@ -471,17 +471,17 @@ static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustom { switch (data_type) { case CD_PROP_FLOAT: - return params.extract_input>("Value_Float"); + return params.extract_input("Value_Float"); case CD_PROP_FLOAT3: - return params.extract_input>("Value_Vector"); + return params.extract_input("Value_Vector"); case CD_PROP_COLOR: - return params.extract_input>("Value_Color"); + return params.extract_input("Value_Color"); case CD_PROP_BOOL: - return params.extract_input>("Value_Bool"); + return params.extract_input("Value_Bool"); case CD_PROP_INT32: - return params.extract_input>("Value_Int"); + return params.extract_input("Value_Int"); case CD_PROP_QUATERNION: - return params.extract_input>("Value_Rotation"); + return params.extract_input("Value_Rotation"); default: BLI_assert_unreachable(); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc index acb9a225492..c112f56fccf 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc @@ -246,32 +246,32 @@ static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustom switch (data_type) { case CD_PROP_FLOAT: if (params.output_is_required("Attribute_001")) { - return params.extract_input>("Attribute_001"); + return params.extract_input("Attribute_001"); } break; case CD_PROP_FLOAT3: if (params.output_is_required("Attribute")) { - return params.extract_input>("Attribute"); + return params.extract_input("Attribute"); } break; case CD_PROP_COLOR: if (params.output_is_required("Attribute_002")) { - return params.extract_input>("Attribute_002"); + return params.extract_input("Attribute_002"); } break; case CD_PROP_BOOL: if (params.output_is_required("Attribute_003")) { - return params.extract_input>("Attribute_003"); + return params.extract_input("Attribute_003"); } break; case CD_PROP_INT32: if (params.output_is_required("Attribute_004")) { - return params.extract_input>("Attribute_004"); + return params.extract_input("Attribute_004"); } break; case CD_PROP_QUATERNION: if (params.output_is_required("Attribute_005")) { - return params.extract_input>("Attribute_005"); + return params.extract_input("Attribute_005"); } break; default: diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc index 0669bab8113..e9123c85ac3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc @@ -268,17 +268,17 @@ static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustom { switch (data_type) { case CD_PROP_FLOAT: - return params.extract_input>("Value_Float"); + return params.extract_input("Value_Float"); case CD_PROP_FLOAT3: - return params.extract_input>("Value_Vector"); + return params.extract_input("Value_Vector"); case CD_PROP_COLOR: - return params.extract_input>("Value_Color"); + return params.extract_input("Value_Color"); case CD_PROP_BOOL: - return params.extract_input>("Value_Bool"); + return params.extract_input("Value_Bool"); case CD_PROP_INT32: - return params.extract_input>("Value_Int"); + return params.extract_input("Value_Int"); case CD_PROP_QUATERNION: - return params.extract_input>("Value_Rotation"); + return params.extract_input("Value_Rotation"); default: BLI_assert_unreachable(); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc index 9f39ce40e49..a1d971be0b3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc @@ -162,17 +162,17 @@ static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustom { switch (data_type) { case CD_PROP_FLOAT: - return params.extract_input>("Value_Float"); + return params.extract_input("Value_Float"); case CD_PROP_FLOAT3: - return params.extract_input>("Value_Vector"); + return params.extract_input("Value_Vector"); case CD_PROP_COLOR: - return params.extract_input>("Value_Color"); + return params.extract_input("Value_Color"); case CD_PROP_BOOL: - return params.extract_input>("Value_Bool"); + return params.extract_input("Value_Bool"); case CD_PROP_INT32: - return params.extract_input>("Value_Int"); + return params.extract_input("Value_Int"); case CD_PROP_QUATERNION: - return params.extract_input>("Value_Rotation"); + return params.extract_input("Value_Rotation"); default: BLI_assert_unreachable(); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc index 576e56b04ce..36c173b3a46 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc @@ -188,17 +188,17 @@ static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustom { switch (data_type) { case CD_PROP_FLOAT: - return params.extract_input>("Value_Float"); + return params.extract_input("Value_Float"); case CD_PROP_FLOAT3: - return params.extract_input>("Value_Vector"); + return params.extract_input("Value_Vector"); case CD_PROP_COLOR: - return params.extract_input>("Value_Color"); + return params.extract_input("Value_Color"); case CD_PROP_BOOL: - return params.extract_input>("Value_Bool"); + return params.extract_input("Value_Bool"); case CD_PROP_INT32: - return params.extract_input>("Value_Int"); + return params.extract_input("Value_Int"); case CD_PROP_QUATERNION: - return params.extract_input>("Value_Rotation"); + return params.extract_input("Value_Rotation"); default: BLI_assert_unreachable(); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc index 4c3a212eb3f..77f930e724c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc @@ -126,33 +126,33 @@ static void node_geo_exec(GeoNodeExecParams params) GField field; switch (data_type) { case CD_PROP_FLOAT: - field = params.get_input>("Value_Float"); + field = params.extract_input("Value_Float"); break; case CD_PROP_FLOAT2: { - field = params.get_input>("Value_Vector"); + field = params.extract_input("Value_Vector"); field = bke::get_implicit_type_conversions().try_convert(field, CPPType::get()); break; } case CD_PROP_FLOAT3: - field = params.get_input>("Value_Vector"); + field = params.extract_input("Value_Vector"); break; case CD_PROP_COLOR: - field = params.get_input>("Value_Color"); + field = params.extract_input("Value_Color"); break; case CD_PROP_BYTE_COLOR: { - field = params.get_input>("Value_Color"); + field = params.extract_input("Value_Color"); field = bke::get_implicit_type_conversions().try_convert(field, CPPType::get()); break; } case CD_PROP_BOOL: - field = params.get_input>("Value_Bool"); + field = params.extract_input("Value_Bool"); break; case CD_PROP_INT32: - field = params.get_input>("Value_Int"); + field = params.extract_input("Value_Int"); break; case CD_PROP_QUATERNION: - field = params.get_input>("Value_Rotation"); + field = params.extract_input("Value_Rotation"); break; default: break;