diff options
author | Eitan <EitanSomething> | 2021-08-05 18:44:59 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-05 18:44:59 +0300 |
commit | bd44e82b255a231242a1b7ddd59cee7830af20ea (patch) | |
tree | b3792cc885d5f5458bc5418a3586c7c2edfb1d1a /source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc | |
parent | c15635bd8d5483a56107b5c31d8dc0b6a691a767 (diff) |
Geometry Nodes: Add more warnings for out of bounds parameters
Add warning(info) to nodes that don't work when an input value is
out of range. For example, the grid node doesn't work with Vertices X
or Verices Y less than 2.
These are purposefully added as "Info" warnings, because they don't
show in the modifier and they aren't printed to the terminal.
Differential Revision: https://developer.blender.org/D11923
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc index 599c59e4a2e..fe456dc4564 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc @@ -291,6 +291,12 @@ static void geo_node_mesh_primitive_uv_sphere_exec(GeoNodeExecParams params) const int segments_num = params.extract_input<int>("Segments"); const int rings_num = params.extract_input<int>("Rings"); if (segments_num < 3 || rings_num < 2) { + if (segments_num < 3) { + params.error_message_add(NodeWarningType::Info, TIP_("Segments must be at least 3")); + } + if (rings_num < 3) { + params.error_message_add(NodeWarningType::Info, TIP_("Rings must be at least 3")); + } params.set_output("Geometry", GeometrySet()); return; } |