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 8934f00ac5, make sure users
can't set values 0 or less.
This commit is contained in:
@@ -218,7 +218,7 @@ class CurvesGeometry : public ::CurvesGeometry {
|
||||
|
||||
/**
|
||||
* How many evaluated points to create for each segment when evaluating Bezier,
|
||||
* Catmull Rom, and NURBS curves. On the curve domain. Values must be zero or greater.
|
||||
* Catmull Rom, and NURBS curves. On the curve domain. Values must be one or greater.
|
||||
*/
|
||||
VArray<int> resolution() const;
|
||||
/** Mutable access to curve resolution. Call #tag_topology_changed after changes. */
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user