I am looking for a way to get the distance to the closest UV map seam in UV-space as a vector in the node editor. Like this:

enter image description here

The blue dot is the current point of reference, i.e. the point where the current ray being evaluated has struck the object, converted to UV-space.

Ideally I want this value as a vector, but if that is impossible a scalar distance would work. Units should be in UV-space (bottom left corner of UV box is (0, 0), top right is (1, 1)). I am open to python solutions if needed.

One idea I have come up with is to somehow generate an image using Python which gives the vector per pixel (XYZ to RGB). I could then use this image in the node editor.

  • $\begingroup$ By Python solution you mean it's okay to Python for the calculation, but you still need the result available to a node during rendering? I'm not sure if that's possible in general (mesh access while rendering). Even if, it would probably be quite slow without some smart algorithm to find the closest seem. Such things are better coded natively. $\endgroup$ – CodeManX Aug 29 '15 at 16:01
  • $\begingroup$ @CoDEmanX I do need to get the result in the node editor. I am working on a node setup which automatically "clone brushes" across UV seams. $\endgroup$ – PGmath Aug 29 '15 at 16:05
  • $\begingroup$ @CoDEmanX Currently, for testing my node setup, I am manually painting a texture around the seams, this has the disadvantage that it is only a scalar value (and that is super time consuming, bordering on impossible for some meshes). If it is possible to use Python to generate such a map that would work. $\endgroup$ – PGmath Aug 29 '15 at 16:08

Your Answer

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

Browse other questions tagged or ask your own question.