[Bf-blender-cvs] [98a62a5c088] master: Geometry Nodes: Material Index - minor cleanup

Johnny Matthews noreply at git.blender.org
Wed Oct 13 19:33:51 CEST 2021


Commit: 98a62a5c088b18d5dd7d60e733c618d9c3db3a46
Author: Johnny Matthews
Date:   Wed Oct 13 12:32:28 2021 -0500
Branches: master
https://developer.blender.org/rB98a62a5c088b18d5dd7d60e733c618d9c3db3a46

Geometry Nodes: Material Index - minor cleanup

  - Add a versioning comment
  - Indexes to Indices

===================================================================

M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc

===================================================================

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)



More information about the Bf-blender-cvs mailing list