Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-27 11:16:38 +0300
committerJacques Lucke <jacques@blender.org>2021-09-27 11:17:17 +0300
commit617954c1438096810ce8e47f09c25c8311baac4d (patch)
tree8cbca34265f3ee5a867bbe206520309055aab20f /source/blender/blenkernel/intern/geometry_set.cc
parent547f7d23cafb682d3ac6d1348d70caef411ecc51 (diff)
Geometry Nodes: new Instance on Points node
This adds a new Instance on Points node that is a replacement for the old Point Instance node. Contrary to the old node, it does not have a mode to instance objects or collections directly. Instead, the node has to be used with an Object/ Collection Info to achieve the same effect. Rotation and scale of the instances can be adjusted in the node directly or can be controlled with a field to get some variation between instances. The node supports placing different instances on different points. The user has control over which instance is placed on which point using an Instance Index input. If that functionality is used, the Instance Geometry has to contain multiple instances that can are instanced separately. Differential Revision: https://developer.blender.org/D12478
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_set.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_set.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 54e9fadf8ed..1ebdde75f46 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -291,6 +291,19 @@ bool GeometrySet::has_curve() const
return component != nullptr && component->has_curve();
}
+/* Returns true when the geometry set has any data that is not an instance. */
+bool GeometrySet::has_realized_data() const
+{
+ if (components_.is_empty()) {
+ return false;
+ }
+ if (components_.size() > 1) {
+ return true;
+ }
+ /* Check if the only component is an #InstancesComponent. */
+ return this->get_component_for_read<InstancesComponent>() == nullptr;
+}
+
/* Create a new geometry set that only contains the given mesh. */
GeometrySet GeometrySet::create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership)
{