diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-18 05:12:04 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-18 05:12:25 +0300 |
commit | 641bbc820f94668aa0e5beb972d1368475041cc4 (patch) | |
tree | 899712f5500756f154e2b34a93f7acf7e2342728 /source/blender/blenkernel/intern/geometry_component_curves.cc | |
parent | 0bdb5239c1a55e72adf3d3d7c491df3d86cd0b09 (diff) |
Curves: Don't allow resolutions less than 1
While this worked, the result for curves with a resolution of zero was
just a single evaluated point, which isn't useful or intuitive. Using
the attribute validation from 8934f00ac5701ea34, make sure users
can't set values 0 or less.
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curves.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curves.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curves.cc b/source/blender/blenkernel/intern/geometry_component_curves.cc index d8cfe1374dc..4ace68546ac 100644 --- a/source/blender/blenkernel/intern/geometry_component_curves.cc +++ b/source/blender/blenkernel/intern/geometry_component_curves.cc @@ -548,7 +548,7 @@ static ComponentAttributeProviders create_attribute_providers_for_curve() static const fn::CustomMF_SI_SO<int, int> resolution_clamp{ "Resolution Validate", - [](int value) { return std::max<int>(value, 0); }, + [](int value) { return std::max<int>(value, 1); }, fn::CustomMF_presets::AllSpanOrSingle()}; static BuiltinCustomDataLayerProvider resolution("resolution", ATTR_DOMAIN_CURVE, |