Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc
| Show All 22 Lines | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_instance_on_points_declare(NodeDeclarationBuilder &b) | static void geo_node_instance_on_points_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Points").description("Points to instance on"); | b.add_input<decl::Geometry>(N_("Points")).description(N_("Points to instance on")); | ||||
| b.add_input<decl::Bool>("Selection").default_value(true).supports_field().hide_value(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).supports_field().hide_value(); | ||||
| b.add_input<decl::Geometry>("Instance").description("Geometry that is instanced on the points"); | b.add_input<decl::Geometry>(N_("Instance")) | ||||
| b.add_input<decl::Bool>("Pick Instance") | .description(N_("Geometry that is instanced on the points")); | ||||
| b.add_input<decl::Bool>(N_("Pick Instance")) | |||||
| .supports_field() | .supports_field() | ||||
| .description("Place different instances on different points"); | .description("Place different instances on different points"); | ||||
| b.add_input<decl::Int>("Instance Index") | b.add_input<decl::Int>(N_("Instance Index")) | ||||
| .implicit_field() | .implicit_field() | ||||
| .description( | .description(N_( | ||||
| "Index of the instance that used for each point. This is only used when Pick Instances " | "Index of the instance that used for each point. This is only used when Pick Instances " | ||||
| "is on. By default the point index is used"); | "is on. By default the point index is used")); | ||||
| b.add_input<decl::Vector>("Rotation") | b.add_input<decl::Vector>(N_("Rotation")) | ||||
| .subtype(PROP_EULER) | .subtype(PROP_EULER) | ||||
| .supports_field() | .supports_field() | ||||
| .description("Rotation of the instances"); | .description(N_("Rotation of the instances")); | ||||
| b.add_input<decl::Vector>("Scale") | b.add_input<decl::Vector>(N_("Scale")) | ||||
| .default_value({1.0f, 1.0f, 1.0f}) | .default_value({1.0f, 1.0f, 1.0f}) | ||||
| .subtype(PROP_XYZ) | .subtype(PROP_XYZ) | ||||
| .supports_field() | .supports_field() | ||||
| .description("Scale of the instances"); | .description(N_("Scale of the instances")); | ||||
| b.add_output<decl::Geometry>("Instances"); | b.add_output<decl::Geometry>(N_("Instances")); | ||||
| } | } | ||||
| static void add_instances_from_component(InstancesComponent &dst_component, | static void add_instances_from_component(InstancesComponent &dst_component, | ||||
| const GeometryComponent &src_component, | const GeometryComponent &src_component, | ||||
| const GeometrySet &instance, | const GeometrySet &instance, | ||||
| const GeoNodeExecParams ¶ms) | const GeoNodeExecParams ¶ms) | ||||
| { | { | ||||
| const AttributeDomain domain = ATTR_DOMAIN_POINT; | const AttributeDomain domain = ATTR_DOMAIN_POINT; | ||||
| ▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines | |||||