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:
authorJacques Lucke <jacques@blender.org>2022-07-12 18:10:04 +0300
committerJacques Lucke <jacques@blender.org>2022-07-12 18:10:23 +0300
commit1c382a4940c6e609786c92c795a25eb8ff7ea608 (patch)
tree89f5838db144dccf7b704e8adca731739d88a894
parent02aefa7659630258f2eb2498947faf398cb375ff (diff)
Curves: improve error checking in deform curves on surface node
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
index 0a446492c6b..7f03d025db7 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
@@ -218,6 +218,12 @@ static void node_geo_exec(GeoNodeExecParams params)
return;
}
const Curves *self_curves_eval = static_cast<const Curves *>(self_ob_eval->data);
+ if (self_curves_eval->surface_uv_map == nullptr || self_curves_eval->surface_uv_map[0] == '\0') {
+ pass_through_input();
+ const char *message = TIP_("Surface UV map not defined");
+ params.error_message_add(NodeWarningType::Error, message);
+ return;
+ }
/* Take surface information from self-object. */
Object *surface_ob_eval = self_curves_eval->surface;
const StringRefNull uv_map_name = self_curves_eval->surface_uv_map;
@@ -258,12 +264,6 @@ static void node_geo_exec(GeoNodeExecParams params)
Curves &curves_id = *curves_geometry.get_curves_for_write();
CurvesGeometry &curves = CurvesGeometry::wrap(curves_id.geometry);
- if (uv_map_name.is_empty()) {
- pass_through_input();
- const char *message = TIP_("Surface UV map not defined");
- params.error_message_add(NodeWarningType::Error, message);
- return;
- }
if (!mesh_attributes_eval.contains(uv_map_name)) {
pass_through_input();
char *message = BLI_sprintfN(TIP_("Evaluated surface missing UV map: %s"),
@@ -285,7 +285,7 @@ static void node_geo_exec(GeoNodeExecParams params)
TIP_("Evaluated surface missing attribute: rest_position"));
return;
}
- if (curves.surface_uv_coords().is_empty()) {
+ if (curves.surface_uv_coords().is_empty() && curves.curves_num() > 0) {
pass_through_input();
params.error_message_add(NodeWarningType::Error,
TIP_("Curves are not attached to any UV map"));