Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_object_info.cc
| Show All 13 Lines | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mesh_wrapper.h" | #include "BKE_mesh_wrapper.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_volume.h" | |||||
| #include "BLI_math_matrix.h" | #include "BLI_math_matrix.h" | ||||
| static bNodeSocketTemplate geo_node_object_info_in[] = { | static bNodeSocketTemplate geo_node_object_info_in[] = { | ||||
| {SOCK_OBJECT, N_("Object")}, | {SOCK_OBJECT, N_("Object")}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (object != self_object) { | ||||
| BKE_mesh_transform(copied_mesh, transform, true); | BKE_mesh_transform(copied_mesh, transform, true); | ||||
| } | } | ||||
| MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); | MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); | ||||
| mesh_component.replace(copied_mesh); | mesh_component.replace(copied_mesh); | ||||
| mesh_component.copy_vertex_group_names_from_object(*object); | mesh_component.copy_vertex_group_names_from_object(*object); | ||||
| } | } | ||||
| } | } | ||||
| 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); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| params.set_output("Location", location); | params.set_output("Location", location); | ||||
| params.set_output("Rotation", rotation); | params.set_output("Rotation", rotation); | ||||
| params.set_output("Scale", scale); | params.set_output("Scale", scale); | ||||
| params.set_output("Geometry", geometry_set); | params.set_output("Geometry", geometry_set); | ||||
| } | } | ||||
| Show All 23 Lines | |||||