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_set_material.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_set_material.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_material.cc b/source/blender/nodes/geometry/nodes/node_geo_set_material.cc
index c48129acbdc..296b40c6c49 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_set_material.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_set_material.cc
@@ -5,6 +5,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "DNA_curves_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_pointcloud_types.h"
@@ -63,6 +64,7 @@ static void node_geo_exec(GeoNodeExecParams params)
/* Only add the warnings once, even if there are many unique instances. */
bool point_selection_warning = false;
bool volume_selection_warning = false;
+ bool curves_selection_warning = false;
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_mesh()) {
@@ -89,6 +91,12 @@ static void node_geo_exec(GeoNodeExecParams params)
point_selection_warning = true;
}
}
+ if (Curves *curves = geometry_set.get_curves_for_write()) {
+ BKE_id_material_eval_assign(&curves->id, 1, material);
+ if (selection_field.node().depends_on_input()) {
+ curves_selection_warning = true;
+ }
+ }
});
if (volume_selection_warning) {
@@ -101,6 +109,11 @@ static void node_geo_exec(GeoNodeExecParams params)
NodeWarningType::Info,
TIP_("Point clouds only support a single material; selection input can not be a field"));
}
+ if (curves_selection_warning) {
+ params.error_message_add(
+ NodeWarningType::Info,
+ TIP_("Curves only support a single material; selection input can not be a field"));
+ }
params.set_output("Geometry", std::move(geometry_set));
}