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:
authorHans Goudey <h.goudey@me.com>2021-02-02 02:17:39 +0300
committerHans Goudey <h.goudey@me.com>2021-02-02 02:17:39 +0300
commit5494ad43facbc946fdc3e044c632e7621c437339 (patch)
tree98685f6e77628b12bc66bed7aa342f7f15a3c7d5 /source/blender
parent8268e733f6c347872b1958b5115bd96fa592d3e9 (diff)
Geometry Nodes: Output instanced geometry from the object info node
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_object_info.cc36
1 files changed, 8 insertions, 28 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
index d713c191d5d..bc36ff809fa 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
@@ -69,35 +69,15 @@ static void geo_node_object_info_exec(GeoNodeExecParams params)
quat_to_eul(rotation, quaternion);
if (object != self_object) {
- if (object->type == OB_MESH) {
- Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object, false);
- if (mesh != nullptr) {
- BKE_mesh_wrapper_ensure_mdata(mesh);
-
- /* Make a copy because the life time of the other mesh might be shorter. */
- Mesh *copied_mesh = BKE_mesh_copy_for_eval(mesh, false);
-
- if (transform_space_relative) {
- /* Transform into the local space of the object that is being modified. */
- BKE_mesh_transform(copied_mesh, transform, true);
- }
-
- MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();
- mesh_component.replace(copied_mesh);
- mesh_component.copy_vertex_group_names_from_object(*object);
- }
+ InstancesComponent &instances = geometry_set.get_component_for_write<InstancesComponent>();
+
+ if (transform_space_relative) {
+ instances.add_instance(object, transform);
}
- if (object->type == OB_VOLUME) {
- InstancesComponent &instances = geometry_set.get_component_for_write<InstancesComponent>();
-
- if (transform_space_relative) {
- instances.add_instance(object, transform);
- }
- else {
- float unit_transform[4][4];
- unit_m4(unit_transform);
- instances.add_instance(object, unit_transform);
- }
+ else {
+ float unit_transform[4][4];
+ unit_m4(unit_transform);
+ instances.add_instance(object, unit_transform);
}
}
}