Attribute Compare node is writing vertex-groups with no weight. #87102

Closed
opened 2021-04-01 01:14:53 +02:00 by DorianB · 11 comments

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: 645fc0c767

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.
Capture d’écran 2021-04-01 011142.png

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

attrcomparevg.blend

**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: `645fc0c767` **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. ![Capture d’écran 2021-04-01 011142.png](https://archive.blender.org/developer/F9916352/Capture_d_écran_2021-04-01_011142.png) 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 [attrcomparevg.blend](https://archive.blender.org/developer/F9916354/attrcomparevg.blend)
Author

Added subscriber: @dodododorian

Added subscriber: @dodododorian

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

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

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

Added subscriber: @wannes.malfait

Added subscriber: @wannes.malfait
Member

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)
image.png

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

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) ![image.png](https://archive.blender.org/developer/F9921720/image.png) Alternative 2: Use a temporary attribute, and then overwrite with the attribute convert node. ![image.png](https://archive.blender.org/developer/F9921728/image.png)
Author

In #87102#1141479, @wannes.malfait wrote:
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?

> In #87102#1141479, @wannes.malfait wrote: > 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?
Member

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.

> 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.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Member

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.

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.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87102
No description provided.