diff options
author | Hans Goudey <h.goudey@me.com> | 2021-02-17 17:30:15 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-02-17 17:30:15 +0300 |
commit | 53bf04f2844b64cd9f79bedd047eac9690f872e3 (patch) | |
tree | 5f66fbf888ee86ded53ebe3ff6fc4efe098080e6 /source/blender/nodes | |
parent | 37de612104dfae77ad34e3f76e77b3aa277c78fa (diff) |
Geometry Nodes: Expose material index attribute
The `material_index` attribute can adjust which material in the list
will be applied to each face of the mesh. There are two new things
about this attribute that haven't been exposed by the attribute API yet.
Each comes with limitations:
1. Integer data type: Most attribute nodes are currently written to use
float data types. This means that they can't write to this attribute
because they can't change the type of a built-in attribute.
2. Polygon domain: This is our first attribute using the polygon domain,
meaning until some of the interpolations are implemented, some
operations may not work as expected.
Currently the two nodes that work with this attribute are Attribute Fill
and Attribute Randomize.
Differential Revision: https://developer.blender.org/D10444
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc index 3f6f28f2826..4e15f232934 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc @@ -221,8 +221,9 @@ static void join_components(Span<const MeshComponent *> src_components, Geometry MeshComponent &dst_component = result.get_component_for_write<MeshComponent>(); dst_component.replace(new_mesh); - /* The position attribute is handled above already. */ - join_attributes(to_base_components(src_components), dst_component, {"position"}); + /* Don't copy attributes that are stored directly in the mesh data structs. */ + join_attributes( + to_base_components(src_components), dst_component, {"position", "material_index"}); } static void join_components(Span<const PointCloudComponent *> src_components, GeometrySet &result) |