diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2021-10-13 20:32:28 +0300 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2021-10-13 20:32:28 +0300 |
commit | 98a62a5c088b18d5dd7d60e733c618d9c3db3a46 (patch) | |
tree | db4fb8604ae253e2c8eb94c8ad146760af786896 /source/blender | |
parent | 366cea95c5d95dccdf30fe15216a3b30174406d3 (diff) |
Geometry Nodes: Material Index - minor cleanup
- Add a versioning comment
- Indexes to Indices
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 2 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc | 6 |
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) |