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:
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc22
1 files changed, 9 insertions, 13 deletions
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 6d371c27d43..31b38c0dce7 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
@@ -27,13 +27,15 @@ namespace blender::nodes {
static void geo_node_curve_sample_declare(NodeDeclarationBuilder &b)
{
- b.add_input<decl::Geometry>("Curve");
- b.add_input<decl::Float>("Factor").min(0.0f).max(1.0f).subtype(PROP_FACTOR).supports_field();
- b.add_input<decl::Float>("Length").min(0.0f).subtype(PROP_DISTANCE).supports_field();
-
- b.add_output<decl::Vector>("Position").dependent_field();
- b.add_output<decl::Vector>("Tangent").dependent_field();
- b.add_output<decl::Vector>("Normal").dependent_field();
+ b.add_input<decl::Geometry>(N_("Curve"))
+ .only_realized_data()
+ .supported_type(GEO_COMPONENT_TYPE_CURVE);
+ b.add_input<decl::Float>(N_("Factor")).min(0.0f).max(1.0f).subtype(PROP_FACTOR).supports_field();
+ b.add_input<decl::Float>(N_("Length")).min(0.0f).subtype(PROP_DISTANCE).supports_field();
+
+ b.add_output<decl::Vector>(N_("Position")).dependent_field();
+ b.add_output<decl::Vector>(N_("Tangent")).dependent_field();
+ b.add_output<decl::Vector>(N_("Normal")).dependent_field();
}
static void geo_node_curve_sample_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@ -237,12 +239,6 @@ static void geo_node_curve_sample_exec(GeoNodeExecParams params)
params.set_output("Normal", fn::make_constant_field<float3>({0.0f, 0.0f, 0.0f}));
};
- if (geometry_set.has_instances()) {
- params.error_message_add(
- NodeWarningType::Info,
- TIP_("The node only supports realized curve data, instances are ignored"));
- }
-
const CurveComponent *component = geometry_set.get_component_for_read<CurveComponent>();
if (component == nullptr) {
return return_default();