I want to store different colors per vertex group in an attribute map.
All assigned verts in vertex group1 = green
All assigned verts in vertex group2 = blue.

On my test cube all top vertices are selected and in a vertex group called selection and should be colored green.
Best I could come up with is with a separate geometry node,but this makes me lose the edges between top and bottom of the cube.
And also is limited to selection and inverted selection instead of multiple vertex groups.
enter image description here

What's the best approach here?


1 Answer 1


Use a switch or a mix node:


  • $\begingroup$ That works, how do I introduce a third or fourth color based on a vertex group selection?(assuming there are no overlapping vertex groups) $\endgroup$ Commented Dec 5, 2023 at 7:38
  • $\begingroup$ @Tortenrandband by making a tree of switches. $\endgroup$ Commented Dec 5, 2023 at 10:10
  • $\begingroup$ That works (but feels clumsy compared to python api, but I'm still getting used to geo nodes and I really like the fast viewport preview of GN) $\endgroup$ Commented Dec 5, 2023 at 10:49
  • 1
    $\begingroup$ @Tortenrandband In Blender 4 you can use a repeat zone, but you still need to somehow provide the names of vertex groups, so if there's just a few of them, multiple switches seem like the easiest solution. $\endgroup$ Commented Dec 5, 2023 at 12:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .