Jump to content
Sign in to follow this  
whodini

Group Primatives by UV Tile

Recommended Posts

Hey guys, I'm looking into a way to group primitives based on their UV tile. I know how to do this in the viewport by switching to the UV view and selecting the faces of the geometry in the tile I want and clicking group in the shelf. However, I'm looking for a way to do this in vops or using an expression. I want a procedural way to do this. I don't know if the tiles are numbered or how I would go about doing this.

Share this post


Link to post
Share on other sites

well if you are using vopsops you need your UVs to be point UVs (or convert them with an attribute promote) after that you can use something like a floor to to see in which tile the UVs are.

After that you could group the UVs by comparing the floor result with something. You could also use a modulo in between if you want to select every other UV tile for instance.

The same logic applies for using expressions something like floor($MAPU)>0, to select everything beyond the 0-1 range or floor($MAPU)%2==0 to select every other UV tile

for the V direction you can use $MAPV

Edited by acey195

Share this post


Link to post
Share on other sites

Another way to do this is to use the Connectivity SOP with connectivity set to primitive, and "Use UV Connectivity" checked on. This will give you a unique class attribute for each connected set of uvs. Then just follow it up with an Partition SOP to make groups based on the class attribute.

  • Like 1

Share this post


Link to post
Share on other sites

promote your uvs to primitive (works best from vertex), you may want to keep the original so uncheck Delete Original

then just append Partition SOP and write this as a rule

uvtile_`int($MAPU)`_`int($MAPV)`[/CODE]

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×