Attempt at Worldspace UV Mirror in Geometry Nodes: having problems


This image is what I’ve got so far, but every so often I run into a problem with UV’s getting stretched, and I can’t really pin down what causes it.
My first idea was to sample index in the UV space and transfer attributes to the original mesh so it’d be less destructive, but that was beyond me.

@zeroskilz finally created a separate thread for this after fooling around with this solution for a while.

edit: to hopefully clarify the cases where it fails:


Green is the original island to be mirrored from, magenta is the original island I’m attempting to mirror, and blue is the single face that was added to the Mirror Group attribute

1 Like

Hi… couple of clarifications please:

  • What are the Displace nodes doing?
  • Why are you scaling “x - 1” and getting the face-corner index? If you have UV boundaries in the original UV map I expect that this would give you ambiguous results :thinking: - I feel like doing a face scale elements by 0.9 may remove the ambiguity (purely for Sample nearest index)… donno.
  • Can you show the 3D model also please.

Thanks.

2 Likes

In order:
-The displace node simply displaces by normal. I’m breaking faces, pushing them out and then at the end pushing them in by the same value and merging by distance. It’s absolutely imperfect, but I was struggling to find a better solution :grimacing:
-I’m scaling x -1 because I want to get the uv’s on the opposite side of the mesh. I want to mirror uv’s in local X, on faces selected with a boolean attribute. I do this manually with Magic UV’s ‘Mirror UV’s’ function, but want to automate it.

image

The selected face is the only one that has the attribute here.

1 Like

Like zeroskilz mentioned you need to scale faces inwards to get correct corners indices.You can do it without modifying the geometry and do with face corners positions

3 Likes

Thanks @higgsas! Purely out of curiosity, is there a reason you’re not using ‘Scale Elements’ here? I haven’t used Evaluate on Domain yet so I’m mostly wondering what the advantages of using it here are.

Its just unnecessary use in this case because you would still need to split edges and merge it back, its gonna be slower and you will be changing mesh indices order. It will give you same results but its unnecessary to modify mesh just to change attribute.

The Evaluate on Domain will interpolate values from one domain to another. In this case the corners position will be averaged to face domain that will give center of the face, that will be used to push it corners towards

3 Likes

Thanks for the explanation! This’ll be useful to know for the future.

1 Like