Geometry Nodes: Material Index - minor cleanup

- Add a versioning comment
  - Indexes to Indices
This commit is contained in:
Johnny Matthews 2021-10-13 12:32:28 -05:00
parent 366cea95c5
commit 98a62a5c08
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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)