I'd like to generate a UV image of my geometry for import into COPs, almost exactly the same as that created by the ‘Save Texture UV to Image’ function *however* with filled-in polygons rather than outlines. Does anyone know how to do this?
I'd prefer to avoid having to render out using Mantra's UV Object setting as I don't require any material or shading - just a matte of the polygon positions in UV space.
I've searched around the scripts folder to see if the ‘Save Texture UV to Image’ function was implemented as a python script (that way I could modify it for my own purposes) but couldn't find it (must be implemented internally).
I couldn't find a COP node that would ‘fill in’ around the edges of my wireframe shapes either - something like that would do as a workaround.
Welcome any suggestions. Thanks.
Save Texture UV to Image *with Fill*
7330 6 2-
- AndrewJBeard
- Member
- 50 posts
- Joined: Aug. 2009
- Offline
-
- tamte
- Member
- 9380 posts
- Joined: July 2007
- Offline
-
- eitht
- Member
- 257 posts
- Joined: Nov. 2010
- Offline
-
- mark
- Staff
- 2675 posts
- Joined: July 2005
- Offline
AndrewJBeard
I'd like to generate a UV image of my geometry for import into COPs, almost exactly the same as that created by the ‘Save Texture UV to Image’ function *however* with filled-in polygons rather than outlines. Does anyone know how to do this?
I'd prefer to avoid having to render out using Mantra's UV Object setting as I don't require any material or shading - just a matte of the polygon positions in UV space.
I've searched around the scripts folder to see if the ‘Save Texture UV to Image’ function was implemented as a python script (that way I could modify it for my own purposes) but couldn't find it (must be implemented internally).
I couldn't find a COP node that would ‘fill in’ around the edges of my wireframe shapes either - something like that would do as a workaround.
Welcome any suggestions. Thanks.
Save to texture uses the “wren” renderer (wireframe renderer). It uses the -u option to render uv coordinates instead of P. The -m option on wren will provide different “fill” options. From the command line help:
Usage: wren
Options:
-w width Specify width of output image
-h height Specify height of output image
-n Render image in negative
-V level Set verbose level
-l width Specify line width in pixels
-s Render with no smoothing
-L val Global level of detail multiplier
-J jitter Specify jittering
-c Disable point consolidation
-u attrib UV render of the named attribute
-m model Specify shading model, where model is:
0 = white wire/normal fill (default)
1 = black wire/normal fill
2 = white wire/ghost fill
3 = black wire/ghost fill
4 = white wire/matte fill
5 = black wire/matte fill
-p Output a PostScript file
-P Output polygons in PostScript mode
You might try hunting around for other forum posts on using wren.
-
- grayOlorin
- Member
- 1807 posts
- Joined: Oct. 2010
- Offline
Another solution you can try is this if you are going straight to COPs:
-wire a vertexSplit sop to separate your mesh at the uv borders (enter uv as your split attribute)
-using a point sop, swap your TX, TY, TZ for your MAPU, MAPV, MAPW. You should end up with a geometry that looks like your UVs.
- use a geometry COP to import your geometry uv as a matte in your COP network
Let me know if you need more help and I can post an example (not at computer right now
)
-wire a vertexSplit sop to separate your mesh at the uv borders (enter uv as your split attribute)
-using a point sop, swap your TX, TY, TZ for your MAPU, MAPV, MAPW. You should end up with a geometry that looks like your UVs.
- use a geometry COP to import your geometry uv as a matte in your COP network
Let me know if you need more help and I can post an example (not at computer right now
)
-G
-
- AndrewJBeard
- Member
- 50 posts
- Joined: Aug. 2009
- Offline
Don't have Photoshop installed, tamte, but your second suggestion worked great! Simply used a Point SOP to map UVs to position, and then rendered to COPs using the Geometry COP. This is pretty much the same as your suggestion, grayOlorin.
I played around with Wren, mark, and it looks as though I can accomplish the same job. I feel the above solution is more elegant as it doesn't require a camera to be pointed to my geometry in order for it to be rendered: I could not get Wren to work without a camera. Perhaps this is a feature that might be added to Wren / Mantra when rendering UVs…?
My next problem is how to get the UVUnwrap SOP to arrange polygons in UV space a little more sensibly: at the moment I cannot get it to seperate out polygons with unique points (i.e. faceted surfaces) whilst keeping polygons with shared points adjacent. Is there any way to enforce this?
I played around with Wren, mark, and it looks as though I can accomplish the same job. I feel the above solution is more elegant as it doesn't require a camera to be pointed to my geometry in order for it to be rendered: I could not get Wren to work without a camera. Perhaps this is a feature that might be added to Wren / Mantra when rendering UVs…?
My next problem is how to get the UVUnwrap SOP to arrange polygons in UV space a little more sensibly: at the moment I cannot get it to seperate out polygons with unique points (i.e. faceted surfaces) whilst keeping polygons with shared points adjacent. Is there any way to enforce this?
-
- grayOlorin
- Member
- 1807 posts
- Joined: Oct. 2010
- Offline
Ugh. There is not a TON of flexibility in that area. Sometimes, what I do is to actually use the point SOP approach to turn my UVs into geometry space, and leverage all the geometry SOPs
However, have you tried the UVPelt SOP? You can basically determine your border edges (a vertexSplit may do the trick) and then pelt your UVs outward
Ideally you would want to do an unwrap using lsmc, but that Is unfortunately not available (although I believe someone wrote a plugin for that if you google it)
Hope it helps!
However, have you tried the UVPelt SOP? You can basically determine your border edges (a vertexSplit may do the trick) and then pelt your UVs outward
Ideally you would want to do an unwrap using lsmc, but that Is unfortunately not available (although I believe someone wrote a plugin for that if you google it)
Hope it helps!
-G
-
- Quick Links


