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:
authorJohnny Matthews <johnny.matthews@gmail.com>2021-10-13 20:32:28 +0300
committerJohnny Matthews <johnny.matthews@gmail.com>2021-10-13 20:32:28 +0300
commit98a62a5c088b18d5dd7d60e733c618d9c3db3a46 (patch)
treedb4fb8604ae253e2c8eb94c8ad146760af786896
parent366cea95c5d95dccdf30fe15216a3b30174406d3 (diff)
Geometry Nodes: Material Index - minor cleanup
- Add a versioning comment - Indexes to Indices
-rw-r--r--source/blender/blenloader/intern/versioning_300.c2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index db2bb73108b..e5b2536f123 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -1746,6 +1746,8 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ /* Update the idname for the Assign Material Node to SetMaterial */
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
if (ntree->type != NTREE_GEOMETRY) {
continue;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc b/source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc
index ebf6b43ae30..66ca0d5b979 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc
@@ -41,12 +41,12 @@ static void set_material_index_in_component(GeometryComponent &component,
selection_evaluator.evaluate();
const IndexMask selection = selection_evaluator.get_evaluated_as_mask(0);
- OutputAttribute_Typed<int> indexes = component.attribute_try_get_for_output_only<int>(
+ OutputAttribute_Typed<int> indices = component.attribute_try_get_for_output_only<int>(
"material_index", ATTR_DOMAIN_FACE);
fn::FieldEvaluator material_evaluator{field_context, &selection};
- material_evaluator.add_with_destination(index_field, indexes.varray());
+ material_evaluator.add_with_destination(index_field, indices.varray());
material_evaluator.evaluate();
- indexes.save();
+ indices.save();
}
static void geo_node_set_material_index_exec(GeoNodeExecParams params)