Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_shade_smooth.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_set_shade_smooth_cc { | namespace blender::nodes::node_geo_set_shade_smooth_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Geometry")).supported_type(GEO_COMPONENT_TYPE_MESH); | b.add_input<decl::Geometry>(N_("Geometry")).supported_type(GEO_COMPONENT_TYPE_MESH); | ||||
| b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().field_on_auto(); | ||||
| b.add_input<decl::Bool>(N_("Shade Smooth")).supports_field().default_value(true); | b.add_input<decl::Bool>(N_("Shade Smooth")).field_on_auto().default_value(true); | ||||
| b.add_output<decl::Geometry>(N_("Geometry")); | b.add_output<decl::Geometry>(N_("Geometry")).propagate_from_auto(); | ||||
| } | } | ||||
| static void set_smooth(Mesh &mesh, | static void set_smooth(Mesh &mesh, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<bool> &shade_field) | const Field<bool> &shade_field) | ||||
| { | { | ||||
| if (mesh.totpoly == 0) { | if (mesh.totpoly == 0) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||