Create UV Templates directly from Poser
ghostship last edited by
@anomalaus apparently High Sierra Has a new file system structure (APFS) and other programs are having problems with it. Propellerheads just released a fix for Reason because High Sierra was damaging files for the program.
@ghostship Thanks for the heads-up. I'll definitely want to hold off on upgrading any filesystems to APFS then until I know how it will affect bootcamp partitions. I use the Paragon NTFS for MacOS and HFS+ for Windows products so I have full access to all files on both boot platforms (though I might turn off windows' access to my MacOS boot volume as it writes temporary windows upgrade files there without my express permission, GRRR! I actually had to run Disk Doctor on the MacOS boot SSD after my last Windows 10 boot because of this. Exceedingly Ungood!)
Righto, a further blind fumble in random direction. Ignoring a couple of minor logic puzzles left to solve (re: using a single colour for seam facets which share a common vertex. See the corner) I have progressed on colouring texture seams and labelling body parts (well, facet numbering, anyway).
See below the standard Poser box prop with a script generated UV template applied as a texture.
Note: the edges with white, numbered facets are not texture seams.
And the template itself:
Note: the "mystery" edge, which has pairs of coloured facets, but shouldn't actually be a seam. I will have to delve into the actual object definition and determine whether the texture vertices at this point are identical (some kind of logic fault on my part) or are duplicated (a common fault of many meshes) but with identical texture coordinates.
The numbering serves the dual purpose of giving me a quick reference into my internal data structures for debugging and tests the functionality of text placement (centred within each facet - not pretty on high density meshes, LOL) on the UV template.
englishbob last edited by
@anomalaus Which Poser box prop is that? The one I dug up from my geometries folder, meaning to address your question about the mystery edge, has (geometry) faces which have 64 (mesh) facets each; and each (geometry) face is UV mapped from 0, 0 to 1, 1 such that every face's map is the same. It's quite probable that I've overwritten something along the way, of course.
But never mind all that, are those the actual facet numbers showing there - as in, the index of the facet definition in the OBJ file? In which case, I want it. There's no other UV mapping utility that I know of which does that, and that knowledge would be invaluable when I'm hacking OBJ files by hand for fun! I have an unusual definition of fun. :)
@englishbob it's the one called simply "Cube" in Runtime/Libraries/Props/Primitives/Morphing Primitives/. The object is called D3D_Cube.obz (compressed), so it's a prop from the late Ralph Sessler (Dimension3D). My script gives me these stats for it:
Counted 1200 facet edges
Counted 80 seam edges
Num Verts = 602 (602)
Num TVerts = 682 (682)
Num Norms = 602 (602)
Num TSets = 2400
Num Elems = 600
Num Sets = 2400
Num Seams = 80
Num Sections = 0
Num Groups = 0
Num Materials = 1
UV Range = ((0.0, 0.99999999), (0.0, 0.99999999))
No, sorry, my mistake calling it "box", the one you found called "box", with all the cube faces mapped to the same texture vertices was useless for my purposes. It doesn't have enough texture vertices to separately map each face.
They are indeed the actual facet numbers, though good luck trying to read them on a high density figure ;-) Since I'm choosing to colour facets, rather than edges, any really low-poly prop (think of a cube with just 6 facets) won't be able to show facets bordering seams effectively. My initial display mechanism was to use different colours for the edges of different group facets, so one could fall back to that method for low-poly props.
@englishbob well, maybe it won't be so bad. This looks almost useful ;-)
I upped the template dimensions to 2048x2048 and the seam facets between Genesis8Female's torso and leg look almost comprehensible ;-)
englishbob last edited by
I should probably look in Poser's installed library more often. :)
That cube does seem to have un-compacted UV coordinates (it has 682, but needs only 671 - I think...)
In my opinion, the unnecessarily coloured facets aren't a big problem, more of a cosmetic defect. I suppose they may become confusing on a more complex mesh.
Let me know if you want me to try making a better box. I think UVMapper Professional should be able to do the job.
They are indeed the actual facet numbers, though good luck trying to read them on a high density figure ;-)
That's fine for me, I doubt I would try manually hacking a high density mesh. Even I have my limits. :)
@englishbob actually, I think the mesh on that cube is pretty good. 10x10 facets per face = top and bottom faces of 11x11 = 121 vertices = 242 plus 9 rows of 40 vertices = 360 + 242 = 602. Spot on. Texture vertices 11x11 for the centre of the cross = 121 + 5 * (10 x 11) = 671 + 11 for that extra seam would make the difference up to 682.
Good, not a logic problem then, just a mesh with a surplus texture seam.
Could you possibly offer some thoughts on situations when the capability of this script would be useful anomalaus?
ribroast last edited by
So, this script will generate the seam guides as in the picture above? I would definitely find that very useful. Looking forward to seeing the finished result.
@matb heh, [carefully extracting self from engine bay, so as not to crack bonce on bonnet (harm head on hood)] well, I shouldn't be surprised that there are folks who don't immediately see the facility in everything I choose to waste my time on. ;-)
If, for instance, Poser happened to have a 3D painting tool (think of the morph brush, but applying texture to a model) which could accurately paint over body part seams, to apply a logo to a t-shirt or paint a transparency map to turn a bodysuit into a bikini, nobody would particularly need a separate application to do such a thing. Since Poser doesn't, at the moment, have such a feature, artists either purchase an app which does what they want (there are some around) or they try to find ways to make use of the tools they do have (MSPain, CorelDrab, Photoslop, or whatever), despite those tools being suited for 2D artworks only. This is where the UV texture templates and seam guides become necessary, so you can line up the edges of textures across body-part/material boundaries in different image maps.
If you are one of the lucky few who never paints textures or already owns a 3D texturing app, then all of this is internalised and invisible, so you never need to remember where the bonnet/hood release lever hides under the dashboard to check oil or radiator fluid levels.
Those of us who have been around since Poser 1 have had to make do with what was available. Such habits die hard and become a way of life.
In the ultimate end, though, this is just about me exercising my python scripting muscles. If that helps anyone else, well that's a bonus. If it's not the new orange for someone, they can just scroll to the next slice of bread. ;-)
@anomalaus Thanks for your answer, but perhaps I misunderstand what your script does. I am painfully aware of the problem in creating textures, especially when it comes to painting across seams, and I appreciate the value of creating nice clean UV map templates, but that job is already done by the model's designer before we see it in Poser correct? It looks to me, and this is where I am confused, as though your script creates flattened geometry with UV templates on, which can then be rendered and used as the basis for creating your own maps? Why would I use this script rather than simply importing into a free app such a UVmapper, or a commercial product like Blacksmith or ZBrush where I can simply paint across seams?
I'm all for useful scripts, I'm just not sure that I properly appreciate what problem yours solves that is not already well solved by other free apps? Forgive me if I am missing some very useful utility to your program.
@matb in my earlier replies:
@morkonan UVX from Steve Cox, the original developer of UVMapper has long been obsolete and incompatible with the latest versions of MacOS (last release in 2006). >That's where I come from, and why I'm far more interested in a tool available directly within Poser.
MacOS is my primary Poser platform. No version of UVMapper runs natively on the latest version of MacOS, though the program originated on that platform, since it has not been updated for MacOS since 2006 (when it went commercial and boosted sales by an order of magnitude by converting to Windows)! I delve into Windows 10 via bootcamp (when I can make it work, that is, since it breaks with virtually every MacOS update, wasting days of my time to get it running again) purely for compatibility testing of python scripts in Poser.
I have yet to HTFU enough to learn sufficient Blender to do UV mapping there, since this script will be functional in less time than it would take me to learn to do that in Blender. I am also unable to contemplate ever being able to afford to purchase software speculatively again, so BS and ZB are out of the picture. I dread the necessary evil of paid upgrades to Poser, as I am addicted to eating regular meals :-/
re: your assertion:
I appreciate the value of creating nice clean UV map templates, but that job is already done by the model's designer before we see it in Poser correct?
Be that as it may, where are the templates for all the props included with Poser, or the freebies you might have downloaded from some long defunct forum? Assuming they are even usefully UV mapped at all (see the box prop which has all faces with overlapping UV maps - can't make six-sided dice with that prop!) Do the templates come with seam guides, for those that want such things? Can UVMapper Lite create seam guides automatically? Or Blender?
If one owns 3D texturing software, I cannot think of a single reason (except perhaps misplaced pity for my impoverished circumstances, LOL) why you would bother with UV templates or seam guides ever again (perhaps prompting DAZ to blow off SnowSultan).
Mesh creators who wish to maximise the utility of their products for purchasers of all calibres, create UV mappings and provide the templates so their products can be conveniently re-textured by purchasers, including those whose circumstances preclude their use of free UV mapping apps or the purchase of 3D texturing apps. Seam guides have only ever been provided by after-market vendors like SnowSultan, as they have never, AFAIK till the advent of this script, been automatically generated.
I am aware that the initial iterations of the script were perhaps confusing in that I chose to demonstrate progress with what I had on hand at the time, i.e. props whose vertices were derived from the texture vertices of the original object mesh, prior to my investigation of the necessary methods to create image files. @fverbaas then mentioned that that interim, developmental step could be useful in actually creating clothing panels which could, IIUC, perhaps be reverse transformed via a morph from the flattened UV template shape into the actual object shape, eliminating the seams, as though actually making clothing from flat cloth panels, an idea which might actually fly, though I've only just now considered it while typing this. 8-O
The script's current incarnation (though I will not abandon the possibility that someone might find UV flattened props useful) simply creates UV templates with seam guides and optional facet numbering. When I manage to complete the GUI for it, I expect to offer options on whether to colour seams, and display facet numbers. The current script randomly assigns colours to groups and seam facets, and I can imagine some folks would like that process to be deterministic or at least configurable, though that will take some further thought and feedback.
@matb BTW, please to not read anything into the tone of my responses other than personal frustration that I have failed to explain myself clearly, due to being too immersed in the development process and unable to immediately infer why my walls of text were TL;DR ;-)
@anomalaus Thank you so much for taking the time to explain clearly. Perhaps I have been spoiled by DAZ content which always includes seam guides, so I assumed that this was not an issue that might be problematic for people. I'm jealous of your Python scripting abilities. Did it take you long to learn?
Glen85 last edited by
WTF is wrong with you, man? Just render yourself a pizza, for goodness sake! If you stare at it long enough, you won't feel hungry anymore! ;)
anomalaus last edited by anomalaus
This has a promise of being very useful indeed. It is a key step in developing some funcionality like in Marvelous Designer. If the UV's are flat and true-size and seams, indeed, are known, and the 'material' making the seams can be made to shrink to zero in simulation, in principle the cloth room could do the refits I now do in MD, and the Poser geometry tools can be used to size the panels.
Not sure if this: [URK, not enough privileges to upload an MP4 movie, I'll link it below]
UVs are flat, but what defines "true-size"? Texture vertex spacing matching object vertex spacing? There are vanishingly small numbers of figures that would ever conform to that requirement due to different level-of-detail requirements for different body parts like faces and hands, when compared to limbs and torsos. I guess clothing figures would differ. There will always be distortion when mapping curved shapes from 3D to 2D, by geometric definition. There is no such thing as a distortion-free planar mapping unless an object has only planar facets and adjacent facets are not constrained to share edges when unwrapping, though that makes for ugly and unpaintable UV maps.
I haven't bothered to preview the UV templates in this script version (commented out), just saved the images to files and applied them to the UVtemplate object.
It's right an the top of my Things To Procrastinate About list
I plan to steal that phrase and use it often. Just as soon as I get around to it. :)
Lol thank you, made me smile!
@anomalaus Really useful! Thank you!
F_Verbaas last edited by F_Verbaas
Yes, there will always be distortion. Yet, when you wear a cotton shirt with a blue checkerboard pattern, it is built from flat panels of cotton fabric with a blue checkerboard pattern. The distortion is what the cotton fabric permits (not much) and yet the shirt fits you.
If you take the shirt apart at the seams you can lay the panels before you at the table. You can arrange the panels such that the blue checker board pattern matches. If the table is say 1.50 m square, that what you see would be your true size UV map.
If you use the panels as a template to cut new panels from red-striped fabric and sew them together you have a red striped shirt. The digital equivalent of this is of course to apply a tilable texture. The UV is therefore VERY workable and provided you choose materials wisely it is as easy as changing the referenced tile. .
Clothing items are mainly made by dividing the very non-developabl shape of the body into sections that are more or less developable.
See below a bodice block I quickly traced from Genesis 8 yesterday.with MD7. (True scale UV's the grid on the background is 10 cm size)
The figure is pretty busty but yet the panels fit with moderate strain: (Strainmap legend: green = 0% strain, yellow 10% and red 20%).
with a tad too much space at the points of the breasts (we really need softbody simulation)
which is solved with a touch of the steam brush (but hey I am disgressing)
What meant to say is that the 2D -> 3D vv. conversion opens a lot more possibilities.
@F_Verbaas I imagine that on a per-group basis, using a metric of mean facet edge length (assuming predominantly quadrilateral facets), and applying that mean length to the texture facets of corresponding groups will produce "True Size" UV Templates, perhaps? Of course this is a distinction which is only relevantly applied to clothing, since human and animal figures tend to be predominantly unique (non-tiled) in their per-group texturing, apart from external bi-lateral symmetry, though that is frequently broken in Poser UV mapping schemes (see V4's arms)
Can you explain the process you imagine being possible in Poser with appropriate development of this script? I do not envisage turning this into a full UV remapper at this stage, given that the ability to define and pin seams and select unwrapping schemes is freely available in Blender on multiple platforms, but I can imagine simply being able to rescale and reposition each group's UV map individually, before creating an object which could be procedurally textured and wrap with a single morph into the original object's shape for use in the Poser Fitting Room or Cloth Room. [When I last used them, I continually wished for a tool to apply tension to cloth along selected axes and boundaries]
I am eternally wary of the baying of the ravening, slavering pack of rabid paralegal hounds certain content vendors threaten to unleash on any means to breach their EULA. When you refer to tracing Genesis 8, I know, of course, that you're referring to the 8th chapter of the first book of the Torah ;-)