Geometry nodes: removing attributes via regex #116833

Open
Eugene-Kuznetsov wants to merge 2 commits from Eugene-Kuznetsov/blender:geonode_remove_attr into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute.

This leads to a performance issue that arises e.g. when geometry nodes are used to make hair. Mesh objects used as hair attachments often have dozens of weight groups. These weight groups stay on points when you do "Distribute points on faces", then get propagated to curves and all the way through any further manipulations with hair.

This PR adds two ways to deal with the issue. It allows the user either to remove any number of named attributes from an object via regex with a single node, or to instruct the "Distribute points on faces" node not to retain named attributes (except for UV maps). Any attributes the user actually wants can still be captured and reapplied explicitly.

In the attached blend file, using either of these two techniques to discard weight groups from the mesh reduces the execution time of the geonode tree in half.

image
image

At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute. This leads to a performance issue that arises e.g. when geometry nodes are used to make hair. Mesh objects used as hair attachments often have dozens of weight groups. These weight groups stay on points when you do "Distribute points on faces", then get propagated to curves and all the way through any further manipulations with hair. This PR adds two ways to deal with the issue. It allows the user either to remove any number of named attributes from an object via regex with a single node, or to instruct the "Distribute points on faces" node not to retain named attributes (except for UV maps). Any attributes the user actually wants can still be captured and reapplied explicitly. In the attached blend file, using either of these two techniques to discard weight groups from the mesh reduces the execution time of the geonode tree in half. ![image](/attachments/0b68863f-4d33-438a-8b2c-159f5f3eb1a6) ![image](/attachments/a9a27770-abfe-451a-a558-54001090eac4)

At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute.

No, you have to use multiple nodes. This is by design, you shouldn't make it more complicated.

> At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute. No, you **have to** use multiple nodes. This is by design, you shouldn't make it more complicated.
Iliya Katushenock added this to the Nodes & Physics project 2024-01-06 08:38:35 +01:00
Iliya Katushenock added the
Interest
Geometry Nodes
label 2024-01-06 08:38:39 +01:00
Eugene-Kuznetsov force-pushed geonode_remove_attr from ce271a65ce to d41feb0b70 2024-01-06 09:14:03 +01:00 Compare
First-time contributor

Hello Eugene, first off, thanks a lot for your contribution, this is something we've been waiting for a long time and a huge pain point in our workflow!

At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute.

No, you have to use multiple nodes. This is by design, you shouldn't make it more complicated.

Hello Illya, I would like to give an input of my experience on how this feature could be very useful in studio pipelines: In our studio, we use geometry nodes pretty heavily, and have a lot of issues with cleaning attributes being dragged from one node group to others. This comes specifically from using node groups heavily from one step of production to the next, on using library overrides and linked collections where a lot of things need to be dynamically detected and processed.

More specifically, we have a massive node group in our current production that takes character collections and generates screen space effects out of them. It works great, however the issue is that the result becomes bogged down with dozens if not hundreds of attributes it picks up from the different weight paint groups from the rigs. Removing them one by one would be impossible, because the whole system is dynamic: The animation collections are linked in the lighting scene, and there is no way to determine beforehand the different characters that will appear in the scene and dynamically detect and remove all the excess attribute groups found in the screen space results.

So from a technical artist/TD perspective, having the ability to automatically clean certain attributes within a node group would be a massive use case, one that is currently impossible with the current tool set.

These are my two cents on the issue, thank you both for your contributions and work!

Hello Eugene, first off, thanks a lot for your contribution, this is something we've been waiting for a long time and a huge pain point in our workflow! > > At present, there is no way to remove multiple attributes from an object with geometry nodes without adding a separate node for each attribute. > > No, you **have to** use multiple nodes. This is by design, you shouldn't make it more complicated. Hello Illya, I would like to give an input of my experience on how this feature could be very useful in studio pipelines: In our studio, we use geometry nodes pretty heavily, and have a lot of issues with cleaning attributes being dragged from one node group to others. This comes specifically from using node groups heavily from one step of production to the next, on using library overrides and linked collections where a lot of things need to be dynamically detected and processed. More specifically, we have a massive node group in our current production that takes character collections and generates screen space effects out of them. It works great, however the issue is that the result becomes bogged down with dozens if not hundreds of attributes it picks up from the different weight paint groups from the rigs. Removing them one by one would be impossible, because the whole system is dynamic: The animation collections are linked in the lighting scene, and there is no way to determine beforehand the different characters that will appear in the scene and dynamically detect and remove all the excess attribute groups found in the screen space results. So from a technical artist/TD perspective, having the ability to automatically clean certain attributes within a node group would be a massive use case, one that is currently impossible with the current tool set. These are my two cents on the issue, thank you both for your contributions and work!

Hello Illya, I would like to give an input of my experience on how this feature could be very useful in studio pipelines: In our studio, we use geometry nodes pretty heavily, and have a lot of issues with cleaning attributes being dragged from one node group to others. This comes specifically from using node groups heavily from one step of production to the next, on using library overrides and linked collections where a lot of things need to be dynamically detected and processed.

More specifically, we have a massive node group in our current production that takes character collections and generates screen space effects out of them. It works great, however the issue is that the result becomes bogged down with dozens if not hundreds of attributes it picks up from the different weight paint groups from the rigs. Removing them one by one would be impossible, because the whole system is dynamic: The animation collections are linked in the lighting scene, and there is no way to determine beforehand the different characters that will appear in the scene and dynamically detect and remove all the excess attribute groups found in the screen space results.

So from a technical artist/TD perspective, having the ability to automatically clean certain attributes within a node group would be a massive use case, one that is currently impossible with the current tool set.

These are my two cents on the issue, thank you both for your contributions and work!

Hi, i see the issue. This PR is not really general and add realy specific thing. To solve your issues i'd prefer to add Delete All kind thing to clean attributes instead of add complicated string.

> Hello Illya, I would like to give an input of my experience on how this feature could be very useful in studio pipelines: In our studio, we use geometry nodes pretty heavily, and have a lot of issues with cleaning attributes being dragged from one node group to others. This comes specifically from using node groups heavily from one step of production to the next, on using library overrides and linked collections where a lot of things need to be dynamically detected and processed. > > More specifically, we have a massive node group in our current production that takes character collections and generates screen space effects out of them. It works great, however the issue is that the result becomes bogged down with dozens if not hundreds of attributes it picks up from the different weight paint groups from the rigs. Removing them one by one would be impossible, because the whole system is dynamic: The animation collections are linked in the lighting scene, and there is no way to determine beforehand the different characters that will appear in the scene and dynamically detect and remove all the excess attribute groups found in the screen space results. > > So from a technical artist/TD perspective, having the ability to automatically clean certain attributes within a node group would be a massive use case, one that is currently impossible with the current tool set. > > These are my two cents on the issue, thank you both for your contributions and work! Hi, i see the issue. This PR is not really general and add realy specific thing. To solve your issues i'd prefer to add `Delete All` kind thing to clean attributes instead of add complicated string.
First-time contributor

I agree that this is a bit specific but it sounds super useful in a more "advanced" / animation production scenario.
A delete all is great, but what I particularly like about the regex is that you can set some rules to delete most of attributes and at the same time keep some of them.

The regex being a string this can even be exposed in the modifier.

Classic scenario is when you have a character with 100/200 vertex group for skinning, and you have like 10/20 attributes either manually setup, or dynamically with another GN ... It's always possible to manually copy the attributes we want to keep, but we loose some flexibility.
Say during the production I'd like to add a new attribute , I'll have to manually add the copy procedure on every asset/shots , where in the other hand this can be made transparent and painless.

A delete all might work pretty well if at least there is some rules for exclusion or inclusion, the regex is quite elegant , but maybe it can be simplified a bit as we probably won't need complex expression, here, even tho I'm pretty sure this can be quite useful in some situations.

I agree that this is a bit specific but it sounds super useful in a more "advanced" / animation production scenario. A delete all is great, but what I particularly like about the regex is that you can set some rules to delete most of attributes and at the same time keep some of them. The regex being a string this can even be exposed in the modifier. Classic scenario is when you have a character with 100/200 vertex group for skinning, and you have like 10/20 attributes either manually setup, or dynamically with another GN ... It's always possible to manually copy the attributes we want to keep, but we loose some flexibility. Say during the production I'd like to add a new attribute , I'll have to manually add the copy procedure on every asset/shots , where in the other hand this can be made transparent and painless. A delete all might work pretty well if at least there is some rules for exclusion or inclusion, the regex is quite elegant , but maybe it can be simplified a bit as we probably won't need complex expression, here, even tho I'm pretty sure this can be quite useful in some situations.
Eugene-Kuznetsov force-pushed geonode_remove_attr from d41feb0b70 to 5f83bce53f 2024-01-10 19:39:55 +01:00 Compare
Eugene-Kuznetsov force-pushed geonode_remove_attr from 5f83bce53f to 57b127874a 2024-01-10 19:40:41 +01:00 Compare
Eugene-Kuznetsov force-pushed geonode_remove_attr from 57b127874a to da8f00dd2d 2024-01-23 22:37:17 +01:00 Compare
Eugene-Kuznetsov force-pushed geonode_remove_attr from da8f00dd2d to 990c1bed1c 2024-01-23 22:39:25 +01:00 Compare
Eugene-Kuznetsov force-pushed geonode_remove_attr from 990c1bed1c to b99d3fe6cf 2024-02-06 08:59:09 +01:00 Compare
Member

Thx for the patch. I'm currently working on a simpler variant of it (#118258) which side-steps the relatively complex discussion about pattern matching languages for now (with the goal of getting the main functionality merged sooner).

Thx for the patch. I'm currently working on a simpler variant of it (#118258) which side-steps the relatively complex discussion about pattern matching languages for now (with the goal of getting the main functionality merged sooner).
This pull request has changes conflicting with the target branch.
  • source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u geonode_remove_attr:Eugene-Kuznetsov-geonode_remove_attr
git checkout Eugene-Kuznetsov-geonode_remove_attr
Sign in to join this conversation.
No reviewers
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 Assignees
5 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#116833
No description provided.