specify min max size for UV

   2479   7   1
User Avatar
Member
39 posts
Joined: Nov. 2014
Offline
I'm trying to make my UVs have a fixed value and scale it so it's U and V value will be between 2 numbers. Think of it like a matchSize node but for UV.
Ideally, I would have hoped that after I got the min and max size of the UV by using an attribute promote to get the min and max. that simply putting it in a fit range would solve it?
Having messaged on Discord (thanks voxelheadD for your input) one suggestion was to use relbbox to set the UV in a vertex wrangle after the uvproject.
@uv = set(relbbox(0, "uvme", @P).x, relbbox(0, "uvme", @P).z, 0);
But this causes the UV to wrap around it's self.


Additionally is there a way to move my UV to UV world center? Thanks in advance

Attachments:
slidingUV.hipnc (73.6 KB)

User Avatar
Member
401 posts
Joined: Nov. 2016
Offline
Hello, is this what you want?

Attachments:
slidingUV_v02.hipnc (88.5 KB)

User Avatar
Member
39 posts
Joined: Nov. 2014
Offline
It's close but if you scale the box in X you can see it sliding a bit.
ideally, I'm hoping to try and find a way to make something like the match size node but for UVs :/ Define a min max area ultimately forming a box and have the UV try and fit inside of it.
User Avatar
Member
401 posts
Joined: Nov. 2016
Offline
This one doesn't slide:

Attachments:
slidingUV_v03.hipnc (96.2 KB)

User Avatar
Member
39 posts
Joined: Nov. 2014
Offline
OMG you are my hero i've literally been up all day working on this problem, I thought I attempted something like this earlier in the day but must have gone wrong somewhere. You are my hero!

I don't suppose you have any idea on my other problem when it comes to translating a UV into the center? I can't seem to find much info when it comes to UVing procedurally in Houdini.
User Avatar
Member
401 posts
Joined: Nov. 2016
Offline
I'm sorry, I'm not so sure what you mean by UV world center.
User Avatar
Member
39 posts
Joined: Nov. 2014
Offline
Sorry my language when it comes to UVs is pretty poor. I'm still approaching UV as I do in 3D and I'm getting the idea this shouldn't be done.

So i'd like to try and simply move the UV the middle of the UDIM procedurally. my current approach was to get the center of the UV and subtract that from 0.5,0.5. like I would I if i wanted to move a point in 3D space to another point.

Before:


After:
Edited by wjm - Feb. 11, 2021 20:15:16

Attachments:
AfterMove.JPG (48.0 KB)
BeforeMove.JPG (46.4 KB)

User Avatar
Member
8599 posts
Joined: July 2007
Offline
you can use UV Transform node for any of those operations, or for all at once

Attachments:
slidingUV_mod.hipnc (98.7 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links