How to use GN to change the weight of a Vertex Group? Or WertexWeightMix manipulation w GN

Hello there,

I’m unable to find any posts or tutorials for the following issue in v. 3.4.

Let’s imagine I hang a cloth object in space and I want the vertex weight of a group, that is used as its Shape / Pin Group to change from 1 to 0 when another object gets close to it (this object follows a physics simulation, so I want to automate the process, since timing changes with each variation).

So, I was thinking it would be best if I can create and manipulate a Vertex Group directly from Geometry Nodes, or to at least manipulate the weight influence, like when using the VertweWeightMix modifier and setting it to Subtract A-A. Any ideas if this is possible?

I only found approaches for changing vertex colors, but that is of no use here I believe?

Thank you!

1 Like

Hello !

You can try this :

The vertex group should exist in the mesh, named attribute allows to read it , Store attribute write it.

It works in this case, and it should on others, but I didn’t test either.
If it doesn’t work on more exotic modifier I won’t be too much surprised !

Have fun !

5 Likes

Have you tried using the Named Attribute nodes?

@sozap beat me to it.

4 Likes

image

6 Likes

superb! I will test those. I only later found out there is a VertexWeightProximity modifier, which kind of does the thing too, but being able to have this in GN would be even better. Thank you for both answers!

1 Like

actually, these two approaches are way better than using the modifier. thank you!!

2 Likes