8

I found this answer by Nathan: Weight paint in cycles nodes?

This is exactly what i want to do: use vertex weight value for "changing colors"/"use in shaders".

Nathans answer seems to be the solution, but...i don't understand it and i don't know how it works. Can somebody give me a step by step tutorial how to do it?

Chris
  • 59,454
  • 6
  • 30
  • 84
  • I'll leave it for a while to see if @Nathan is around.. that's only polite :). In the meantime, I assume you've already seen this – Robin Betts Jun 25 '21 at 09:07
  • 2
    maybe you should put a comment under his answer and ask for some precisions? – moonboots Jun 25 '21 at 09:21
  • If it works „only“ with GN as Robin wrote - I am happy – Chris Jun 25 '21 at 09:22
  • …but I didn’t get it work until now…but fighting – Chris Jun 25 '21 at 09:23
  • @moonboots: that's why i didn't want that comment under Nathans answer. You can read yourself what he wrote.... – Chris Jun 26 '21 at 06:14
  • @RobinBetts: I think you can answer now. I am pretty sure he has seen my question and because of his comment i think he thinks i am not worth to get an answer ;) – Chris Jun 26 '21 at 06:15
  • 2
    @Chris I'm sure it's nothing personal.. Nathan is probably looking for a specific query to answer: with the description already given, it's hard to know what to clarify further... there are quite a few possible gotchas. In the mean time, here's a blend file – Robin Betts Jun 26 '21 at 10:17
  • 1
    I got it working now with your geometry nodes solution ;) my main problem was - it works only in cycles and i always tested with EEVEE ‍♂️ but MANY THANK YOU AGAIN AND AGAIN for your blend file. -> good idea to write the explanation in the text file, especially for me, who doesn't know what I did last week... – Chris Jun 26 '21 at 12:38
  • 1
    ok, i now try to understand Nathans solution - because it works in EEVEE. Rendering in cycles needs days for what i am looking for.... – Chris Jun 26 '21 at 12:44
  • @RobinBetts: got it working now. Thank you!!!! – Chris Jun 26 '21 at 14:08
  • Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue... And it seems you missed an opportunity to answer your own question? – Markus von Broady Feb 07 '22 at 10:01
  • @Chris I'm only now seeing this question-- sorry I didn't respond here. Robin Betts is totally right, it's nothing personal, it's just hard to answer "what am I doing wrong" without knowing what exactly you're doing, and especially hard to do so via comments. GN indeed is a better solution now, and it sounds like you got the original method figured out anyways? – Nathan Feb 07 '22 at 18:10
  • Yes, no problem, Robin helped me – Chris Feb 07 '22 at 18:18
  • My knowledge at that time was very limited and for me as a beginner that answer was hard to understand. Fortunately Robin did provide me the blend file so I could figure it out. – Chris Feb 07 '22 at 18:26

2 Answers2

14

With the geometry nodes it is now possible to use the weight almost directly (however I believe the "Vertex group" node will be added to the shader nodes some day to make it straightforward). Just add geometry nodes modifier to your object and use "Capture attribute" node to make the weight available as an attribute in your shader. Below I have "w1" vertex group and "weight" attribute injected by geometry nodes. Then use this new attribute in the shader.

weight painting

geometry nodes

attributes

shader

vagran
  • 361
  • 4
  • 6
2

All it takes is geometry nodes with an input socket connected directly to an output socket. In the GeometryNodes modifier, you can set input to your vertex group, and output to an attribute for access in your shader. how to use a vertex group in a shader