Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc
| Show All 10 Lines | |||||
| * | * | ||||
| * You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #include "DNA_collection_types.h" | #include "DNA_collection_types.h" | ||||
| #include "BLI_hash.h" | |||||
| #include "BLI_task.hh" | #include "BLI_task.hh" | ||||
| #include "BKE_attribute_math.hh" | |||||
JacquesLucke: Adding that seems unnecessary. | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "BKE_attribute_math.hh" | #include "BKE_attribute_math.hh" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_instance_on_points_cc { | namespace blender::nodes::node_geo_instance_on_points_cc { | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | for (const int range_i : selection_range) { | ||||
| /* Use entire source geometry as instance. */ | /* Use entire source geometry as instance. */ | ||||
| dst_handle = full_instance_handle; | dst_handle = full_instance_handle; | ||||
| } | } | ||||
| /* Set properties of new instance. */ | /* Set properties of new instance. */ | ||||
| dst_handles[range_i] = dst_handle; | dst_handles[range_i] = dst_handle; | ||||
| } | } | ||||
| }); | }); | ||||
| VArray<int> ids = src_component | |||||
| .attribute_try_get_for_read("id", ATTR_DOMAIN_POINT, CD_PROP_INT32) | |||||
| .typed<int>(); | |||||
| if (ids) { | |||||
| VArray_Span<int> ids_span{ids}; | |||||
| MutableSpan<int> dst_ids = dst_component.instance_ids_ensure(); | |||||
| for (const int64_t i : selection.index_range()) { | |||||
| dst_ids[i] = ids_span[selection[i]]; | |||||
| } | |||||
| } | |||||
| if (pick_instance.is_single()) { | if (pick_instance.is_single()) { | ||||
| if (pick_instance.get_internal_single()) { | if (pick_instance.get_internal_single()) { | ||||
| if (instance.has_realized_data()) { | if (instance.has_realized_data()) { | ||||
| params.error_message_add( | params.error_message_add( | ||||
| NodeWarningType::Info, | NodeWarningType::Info, | ||||
| TIP_("Realized geometry is not used when pick instances is true")); | TIP_("Realized geometry is not used when pick instances is true")); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines | |||||
Adding that seems unnecessary.