Page MenuHome

Attribute Compare node is writing vertex-groups with no weight.
Closed, ArchivedPublicBUG

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-31 07:46, hash: rB645fc0c76794

Short description of error
If we are using geometry node to do some vertex-group manipulation,
using attr compare will write a vertex-group with no weight.

In the blend file below, you will see an example of this behavior, the spreadsheet show weight, but none of the values are transferred to the vertex group

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Apr 2 2021, 4:41 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

I'm not sure exactly how it works, but attribute B is actually being overwritten. So it looks like a bug to me.

It seems that this is caused by the return type of the compare node being a boolean attribute, while the vertex group is a float attribute. Since the types don't match, a new Span is created (with the same name), instead of overwriting the vertex group using an implicit conversion. From then on, the attribute B refers to that Span and not the vertex group. There are multiple ways around this, but I'm not sure if this should be considered intended behaviour.

Alternative 1:
Use the Attribute Math node instead (return float attribute so this overwrites)

Alternative 2:
Use a temporary attribute, and then overwrite with the attribute convert node.

It seems that this is caused by the return type of the compare node being a boolean attribute, while the vertex group is a float attribute. Since the types don't match, a

Why is the attr convert node not working then?

Why is the attr convert node not working then?

After the Attribute Compare Node the attribute B refers to a new boolean attribute that has nothing to do with the vertex group B. The Attribute Convert node only modifies this new attribute, and not the vertex group. Due to the fact that they have the same name (B) the vertex group is no longer accessible in the node tree, as any use of the the name B will refer to the boolean attribute instead.

Like I said, this is not very intuitive, and should probably be changed.

This is actually working as expected. There can't be two attributes with the same name and different types. We could change the output type of the attribute compare node, but I'm not sure we should. Either way, this is not a bug, so I'm closing this report. The alternative of using a separate attribute for intermediate computations makes sense to me.