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-03-09 17:27:44 +0300
committerHans Goudey <h.goudey@me.com>2021-03-09 17:27:44 +0300
commit0700441578c9bb4d3f45d59183f26d3293499113 (patch)
tree8253f2645054c56f1677710b66058e8bd970c664 /source/blender/blenkernel/intern/geometry_set_instances.cc
parenteaada565910b4ff31081ced86c3b7242f2f28b4e (diff)
Geometry Nodes: Expose "shade smooth" as an attribute
This patch exposes the "Shade Smooth" value as a boolean attribute. This setting is exposed as a check-box in the mesh data properties, but the value is actually stored for every face, allowing some faces to be shaded smooth with a simple per-face control. One bonus, this allows at least a workaround to the lack of control of whether meshes created by nodes are shaded smooth or not: just use an attribute fill node. Differential Revision: https://developer.blender.org/D10538
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_set_instances.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_set_instances.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc
index 6c4c3231667..f3006385da3 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -378,8 +378,10 @@ static void join_instance_groups_mesh(Span<GeometryInstanceGroup> set_groups,
/* Don't copy attributes that are stored directly in the mesh data structs. */
Map<std::string, AttributeKind> attributes;
- gather_attribute_info(
- attributes, component_types, set_groups, {"position", "material_index", "vertex_normal"});
+ gather_attribute_info(attributes,
+ component_types,
+ set_groups,
+ {"position", "material_index", "vertex_normal", "shade_smooth"});
join_attributes(
set_groups, component_types, attributes, static_cast<GeometryComponent &>(dst_component));
}