Differential D14283 Diff 49071 source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
| Show All 20 Lines | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_distribute_points_on_faces_cc { | namespace blender::nodes::node_geo_distribute_points_on_faces_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| auto enable_random = [](bNode &node) { | |||||
| node.custom1 = GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_RANDOM; | |||||
| }; | |||||
| auto enable_poisson = [](bNode &node) { | |||||
| node.custom1 = GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_POISSON; | |||||
| }; | |||||
| b.add_input<decl::Geometry>(N_("Mesh")).supported_type(GEO_COMPONENT_TYPE_MESH); | b.add_input<decl::Geometry>(N_("Mesh")).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().supports_field(); | ||||
| b.add_input<decl::Float>(N_("Distance Min")).min(0.0f).subtype(PROP_DISTANCE); | b.add_input<decl::Float>(N_("Distance Min")) | ||||
| b.add_input<decl::Float>(N_("Density Max")).default_value(10.0f).min(0.0f); | .min(0.0f) | ||||
| b.add_input<decl::Float>(N_("Density")).default_value(10.0f).min(0.0f).supports_field(); | .subtype(PROP_DISTANCE) | ||||
| .make_available(enable_poisson); | |||||
| b.add_input<decl::Float>(N_("Density Max")) | |||||
| .default_value(10.0f) | |||||
| .min(0.0f) | |||||
| .make_available(enable_poisson); | |||||
| b.add_input<decl::Float>(N_("Density")) | |||||
| .default_value(10.0f) | |||||
| .min(0.0f) | |||||
| .supports_field() | |||||
| .make_available(enable_random); | |||||
| b.add_input<decl::Float>(N_("Density Factor")) | b.add_input<decl::Float>(N_("Density Factor")) | ||||
| .default_value(1.0f) | .default_value(1.0f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| .max(1.0f) | .max(1.0f) | ||||
| .subtype(PROP_FACTOR) | .subtype(PROP_FACTOR) | ||||
| .supports_field(); | .supports_field() | ||||
| .make_available(enable_poisson); | |||||
| b.add_input<decl::Int>(N_("Seed")); | b.add_input<decl::Int>(N_("Seed")); | ||||
| b.add_output<decl::Geometry>(N_("Points")); | b.add_output<decl::Geometry>(N_("Points")); | ||||
| b.add_output<decl::Vector>(N_("Normal")).field_source(); | b.add_output<decl::Vector>(N_("Normal")).field_source(); | ||||
| b.add_output<decl::Vector>(N_("Rotation")).subtype(PROP_EULER).field_source(); | b.add_output<decl::Vector>(N_("Rotation")).subtype(PROP_EULER).field_source(); | ||||
| } | } | ||||
| static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| ▲ Show 20 Lines • Show All 521 Lines • Show Last 20 Lines | |||||