Naming objects based on their UDIM tile?
4758 6 2-
- BrandonRiza
- Member
- 13 posts
- Joined: May 2014
- Offline
Hello.
I'm splitting very dense meshes up with an Attribute VOP, re-UVing the resulting mesh sections, then arraying those UVs into UDIM space. I'm outputting both a re-welded single mesh in addition to all of the mesh sections themselves as a sequence of OBJ files. I need to name each OBJ file in that sequence based on what UDIM tile the mesh occupies; such as “Mesh_1001.obj”, “Mesh_2005.obj”, etc. The attached images show the meshes arrayed in UDIM space and the Subnet i'm (currently) using to both control the output amount and name the meshes. I'm not sure how to go about pulling in the UDIM tile data and assigning it to the mesh name. Is this something i'd do in my current Attribute Wrangle? Any pointers would be much appreciated.
Thanks…
I'm splitting very dense meshes up with an Attribute VOP, re-UVing the resulting mesh sections, then arraying those UVs into UDIM space. I'm outputting both a re-welded single mesh in addition to all of the mesh sections themselves as a sequence of OBJ files. I need to name each OBJ file in that sequence based on what UDIM tile the mesh occupies; such as “Mesh_1001.obj”, “Mesh_2005.obj”, etc. The attached images show the meshes arrayed in UDIM space and the Subnet i'm (currently) using to both control the output amount and name the meshes. I'm not sure how to go about pulling in the UDIM tile data and assigning it to the mesh name. Is this something i'd do in my current Attribute Wrangle? Any pointers would be much appreciated.
Thanks…
-
- tamte
- Member
- 9129 posts
- Joined: July 2007
- Online
1. Attribute Promote you uv attribute from Vertex (or if your uvs are Point from Point) to Primitive level as Average
- uncheck Delete Original
2. in your Prim wrangle do:
3. you can delete prim uv attrib if you don't need it anymore
- uncheck Delete Original
2. in your Prim wrangle do:
int udim = 1001 + int(v@uv.x) + int(v@uv.y)*10; s@name = sprintf("udim_%d", udim);
3. you can delete prim uv attrib if you don't need it anymore
Edited by tamte - July 19, 2018 17:41:17
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- tamte
- Member
- 9129 posts
- Joined: July 2007
- Online
-
- jsmack
- Member
- 8127 posts
- Joined: Sept. 2011
- Offline
-
- BrandonRiza
- Member
- 13 posts
- Joined: May 2014
- Offline
Thanks for the replies, guys. I appreciate the input.
I've made a sample file and verified that the name attrib is jiving with the number of UDIM tiles (reads 4 unique strings…duping the tiles and feeding them into the merge yields 8…), but how would you guys go about spitting out these four tiles into a sequence of bgeo files?
1001.bgeo
1002.bgeo
1003.bgeo
1004.bgeo
Cheers, and thanks.
I've made a sample file and verified that the name attrib is jiving with the number of UDIM tiles (reads 4 unique strings…duping the tiles and feeding them into the merge yields 8…), but how would you guys go about spitting out these four tiles into a sequence of bgeo files?
1001.bgeo
1002.bgeo
1003.bgeo
1004.bgeo
Cheers, and thanks.
-
- tamte
- Member
- 9129 posts
- Joined: July 2007
- Online
-
- BrandonRiza
- Member
- 13 posts
- Joined: May 2014
- Offline
-
- Quick Links