Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_geometry_to_instance.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "BKE_instances.hh" | #include "BKE_instances.hh" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_geometry_to_instance_cc { | namespace blender::nodes::node_geo_geometry_to_instance_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Geometry")).multi_input(); | b.add_input<decl::Geometry>(N_("Geometry")).multi_input(); | ||||
| b.add_output<decl::Geometry>(N_("Instances")); | b.add_output<decl::Geometry>(N_("Instances")).propagate_from_auto(); | ||||
| } | } | ||||
| static void node_geo_exec(GeoNodeExecParams params) | static void node_geo_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| Vector<GeometrySet> geometries = params.extract_input<Vector<GeometrySet>>("Geometry"); | Vector<GeometrySet> geometries = params.extract_input<Vector<GeometrySet>>("Geometry"); | ||||
| std::unique_ptr<bke::Instances> instances = std::make_unique<bke::Instances>(); | std::unique_ptr<bke::Instances> instances = std::make_unique<bke::Instances>(); | ||||
| for (GeometrySet &geometry : geometries) { | for (GeometrySet &geometry : geometries) { | ||||
| geometry.ensure_owns_direct_data(); | geometry.ensure_owns_direct_data(); | ||||
| Show All 21 Lines | |||||