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>2021-10-26 21:00:03 +0300
committerJacques Lucke <jacques@blender.org>2021-10-26 21:00:10 +0300
commit0bfae1b12078ef278a56c6e932c13be5bc9781aa (patch)
tree38122afad7575db55b0aafa3958af8022fe3cdde /source/blender/nodes/geometry/nodes/node_geo_proximity.cc
parentbe3e09ecec5372f87b3e9779adb821867b062be1 (diff)
Geometry Nodes: geometry component type warning system
Previously, every node had to create warnings for unsupported input geometry manually. Now this is automated. Nodes just have to specify the geometry types they support in the node declaration. Differential Revision: https://developer.blender.org/D12899
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_proximity.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_proximity.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
index ec4d6ceb728..f3840df52aa 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
@@ -31,7 +31,8 @@ namespace blender::nodes {
static void geo_node_proximity_declare(NodeDeclarationBuilder &b)
{
- b.add_input<decl::Geometry>("Target");
+ b.add_input<decl::Geometry>("Target").only_realized_data().supported_type(
+ {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD});
b.add_input<decl::Vector>("Source Position").implicit_field();
b.add_output<decl::Vector>("Position").dependent_field();
b.add_output<decl::Float>("Distance").dependent_field();
@@ -214,12 +215,6 @@ static void geo_node_proximity_exec(GeoNodeExecParams params)
params.set_output("Distance", fn::make_constant_field<float>(0.0f));
};
- if (geometry_set_target.has_instances()) {
- params.error_message_add(
- NodeWarningType::Info,
- TIP_("The node only supports realized mesh or point cloud data, instances are ignored"));
- }
-
if (!geometry_set_target.has_mesh() && !geometry_set_target.has_pointcloud()) {
return return_default();
}