4
$\begingroup$

I used to have answer for this but I've lost it.

So, how can I animate weights along curved mesh?

That is, as if you were using 'Select More' after selecting some vertices of the mesh.

Almost like this, but along the curved mesh:

enter image description here

$\endgroup$
0

3 Answers 3

4
$\begingroup$

If you get a base layer of distance along the surface ("geodesic") instead of just the straight-line distance ("euclidian"), you can do the actual animation with a simple offset. I'm doing this with geometry nodes here, you could do it in a shader as well. distance animation

How to get the geodesic distance? You can utilize the automatic bone weighting in Blender. It uses a "heat map" internally, which is the same method commonly used to calculate geodesic distance.

  1. Add two bones, one at the start of the curve and one at the end.
  2. Assign the armature with automatic weights (select mesh, select armature, ctrl + P, "With Automatic Weights").
  3. You can discard the armature and the modifier it creates on the mesh. We only needed it to create vertex groups. enter image description here

The resulting vertex groups follow the surface, rather than just being a straight distance. For use in a shader you need currently need to transfer it to a plain attribute, like i do in the geometry nodes above.

Caveat: The bone weight is normalized to the distance between the two bones, it goes from 0 to 1 instead of encoding actual distance. You may need to scale it to get the behavior you want.

Edit: I made a plugin for computing geodesic distance a while ago. It may be a little more difficult to use, but outputs actual distance. https://github.com/lukas-toenne/geodoodle

$\endgroup$
1
  • $\begingroup$ Thank you so much! Below I added a clarification about how to make that affect the vertex group / vertex weights instead of the shader like you have done. This was a great method :) $\endgroup$ Jul 26 at 14:12
3
$\begingroup$

i don't know whether this is possible with modifiers because they only show results per frame (AFAIK) and cannot "save" old values.

But if i understood your right, you want to "save" the old state, is that right?

So you just could animate the empty along the path and use animation nodes to save the highest value of the proximity like this:

enter image description here

result:

enter image description here

without animation nodes:

enter image description here

$\endgroup$
2
  • $\begingroup$ Where can I find such a node editor? I have not seen this either in the shader editor or in the node geometry. Can you attach the blend file? $\endgroup$
    – arachnoden
    Jul 26 at 13:06
  • 2
    $\begingroup$ it is a free and AMAZING add-on. Called animation nodes. Just search/google for "Blender add-on animation nodes download". Then just install it ;) $\endgroup$
    – Chris
    Jul 26 at 13:07
1
$\begingroup$

@lukas_t method was the way to go. To get the effect into a vertex group, do this:

  1. Create a vertex group called 'distance'
  2. Copy what's in the image

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.