Geometry Nodes: Material Index - minor cleanup
- Add a versioning comment - Indexes to Indices
This commit is contained in:
parent
366cea95c5
commit
98a62a5c08
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue