diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-20 13:49:11 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-20 13:49:28 +0300 |
commit | 8c7c4549d1fba8eb2236fa397d95b32ad1262789 (patch) | |
tree | 3d22e7b87086722a8ce031fcc0daf821373192f9 /source/blender/nodes | |
parent | 11e11c41f2695f6f412079d438b675516aa8151a (diff) |
Geometry Nodes: support Set Position node on instances
Previously, the node would always realize instances implicitly.
Now it can change the position of entire instances.
The Realize Instances node can be used before if the old
behavior is required.
Differential Revision: https://developer.blender.org/D12555
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_set_position.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc index 4c754ddb643..832db76e731 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc @@ -51,12 +51,13 @@ static void set_position_in_component(GeometryComponent &component, static void geo_node_set_position_exec(GeoNodeExecParams params) { GeometrySet geometry = params.extract_input<GeometrySet>("Geometry"); - geometry = geometry_set_realize_instances(geometry); Field<bool> selection_field = params.extract_input<Field<bool>>("Selection"); Field<float3> position_field = params.extract_input<Field<float3>>("Position"); - for (const GeometryComponentType type : - {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) { + for (const GeometryComponentType type : {GEO_COMPONENT_TYPE_MESH, + GEO_COMPONENT_TYPE_POINT_CLOUD, + GEO_COMPONENT_TYPE_CURVE, + GEO_COMPONENT_TYPE_INSTANCES}) { if (geometry.has(type)) { set_position_in_component( geometry.get_component_for_write(type), selection_field, position_field); |