[Solved] A Script for to morph models to their UV maps :-)
Catherine3678ab
Posts: 8,343
Having ever tried to do this for a few items [without a script] this item I came across over at ArtStation [and it's only $2] really got my attention. Unfortunately it's for Maya which is nowhere near that price range [by a mile or 3] so ...
pretty please, could somebody write a script that would do this for Daz Studio? Thank you :-)
Can somebody make a script like this for DS.png
903 x 508 - 304K
Post edited by Catherine3678ab on
Comments
Zbrush can do it
That's nice [says she who doesn't own Zbrush either].
Maybe somebody with Zbrush would like to morph all the figures to their uvmaps and let loose the morphs in the freebies section?
Think I'd still like the ability in D/S for there are lots of items it could be very useful for :-)
does not seem to keep the vertex order sadly
neither does Ultimate Unwrap 3D that also does it
Blender can do it too (and that's free so within your budget (though there's a learning curve as with everything)). I believe it's in these tools: https://blender-addons.org/textools-addon/ - one of the tools is called 'mesh texture' and creates a mesh that can morph from flat (uv-map-shaped) to shape (normal shape).
Disclaimer: I haven't tried it.
As for Daz Studio - it might be possible to script but I'm not sure if it wouldn't need more functionality within DS (you could always import the one from Blender as a morph for DS). Edit: That is unless it changes the vertex order as noted above - again, I haven't tried this). Depending on what you want to use it for, exporting both the flat and shaped versions and using one as a morph for the other might work (as the uv-mapping would be the same so it'd take the same textures in DS).
That looks to be very interesting, thank you :-)
AWESOME! Okay, it doesn't make morphs {in D/S} either BUT the aim of the game was to get a mesh for the uvmaps to assist in painting textures on a flat surface. And at this price, this is just great. I hope those making money pay the man, this is gold.
@ Silent Winter Thank you so much for bringing this to my attention :-)
hahaha ... okay ... in order to do this task, the mesh is cut and that's why there's no morphing back to their figures. BUT there's also no uvmap on it 'as is' either. So one has to uvmap it, unfold it, align it to the desired place. Then export out their new uvmap mesh for painting in the 3D painting program(s). So it's not perfect but then what is. Looking forward to trying this out some more :-)
^Hmm, ok. Why do you want it flat-packed for texturing anyway? Most uv-painting programs (like Armor-Paint, Substance Painter, etc) let you paint on either the mesh or the 2D uv-layout anyway. Most also let you hide bits to reach otherwise hard-to-get-to places.
Blender has another addon that lets you 'explode' the different objects within a mesh (anything not welded together is separated) which might help. But I can't seem to find it (I found an 'explode' modifier but that seemed to be for making an explosion).
Texturing Aids ... wanting the flat-packed uv mesh so the uvs match. Then I add a level or two of smoothing to it [however high Hexagon will let me do that without crashing]. Exporting out that mesh then I can paint on it in 3D Coat adding in more details than the original mesh will permit. Game plan is then to get 3D Coat to export out some nice textures [normals, etc.] which can be applied to the original mesh. Right now I'm working on something for the legacy V4.2.
I also have an ancient copy of Blacksmith3D Paint ... and sadly no it doesn't paint 3D objects as well as some [at least me] had hoped it would. The paint will 'run' down the sides like the objects' uvmaps were never unfolded. And so I wondered what was the point of that ... but anyhow it was in using this program that I decided if I can get 'flat' models that have the same uvs as the models I wanted the textures for, life would be easier. Indeed I did make a few flat texturing aids [all new mesh] which were released some time back for those that wanted them.
Thank you but I do have some 'exploding' morphs and know how to make more if/when I need things like that.
:-) Coaxed Hexagon into getting 2 levels of smoothing :-) Was started in Blender using https://blender-addons.org/textools-addon/
Was thinking while matching the points in Hexagon that it would sure would be nice if the script could do all that too lol ...
Catherine, I am not too sure if your problem has been solved. If not, just wondering if a separate program to do the following might meet your needs:-
I could do this as a Windows 32 bit exe file - it would be a bit basic with no graphics, but should be feasible. Not quick to do, but eminently possible if that would help you.
Regards,
Richard.
Sounds like it's worth a try, I am on Windows! Thank you :-)
OK. I'll think about how to do it until tomorrow and then get started tomorrow evening. I have .obj reading code from my Finite Element modeller I can crib, also all the data structures I'll need. The output methods are available in a partially usable form. So, possibly have 10-20% of the code I need already.
I have a few programs that may be useful already on my website http://www.chestnutpens.co.uk/misc/downloads.html that you may find useful. They cover my 3 main computing interests, cross stitch, CNC machining and 3d modelling utilities. Maybe only the 3d ones would be of interest, but it's surprising what cross-overs can sometimes trigger.
Regards
Richard.
Thank you. I did visit your website and snaggled a couple of items - and the instructions! And discovered a forum for pens!!!
Funny how all the best people enjoy a nice fountain pen too...
Regards,
Richard
you have/had lovely kitties Richard and Tracy
I know. They rather rule our lives. Our current character cat is Ozzie, a 7yo Maine Coon who loves playing fetch with tinsel balls during winter and slaughtering anything ground based that moves during summer (he can't catch birds, though not for want of trying, we have had numerous occasions where we've seen him launch himself off a roof or out of a tree and try to catch a flying bird in mid fall. Never works.). We have two others, but they are less of a handful than Ozzie, the two of them together are much less of a handful than Ozzie. Now the weather has cooled a bit, Ozzie has taken to allowing us to share part of his bed at night. We always, erroneously, thought it was our bed... He's 3'7" (109cm) from tip of front paws to end of back paws when stretched out and takes up rather a lot of room. He may be a small Maine Coon, but that does not make him a small cat!
Regards,
Richard.
Small progress update: done the window and got the open method accepted by the compiler. This means no syntax errors rather than being programmatically correct. Until I have completed the conversion and save methods, can't test it yet. So far about 680 lines of code. I tend to write rather verbose programs, I know, and get things done by the brute ignorance and force method rather than by elegant coding. Should work though.
Okay :-) Looking forward to trying this out.
Further little update: Have got to the stage of writing an in-memory obj file for each surface before it's saved to the HDD. Need to remind myself of the syntax of the obj file before filling in this bit of the framework. It's syntactically correct, but untested so far.
Also, just remembered it'd be useful to check whether the surface has actually got any facets in it - writing an empty obj file would not be very useful. Think there are now heading to 800 lines of code.
... and the anticipation grows :-)
As usual, the 90% of a program is the programming and the other 60% is the debugging. In theory, it works. In practice, there's a little way to go. It's possible I have one level of de-referencing more than I need.
Regards,
Richard
No rush, I understand. Sounds like 'bout the same with modeling. Making the item is only part of the job, then there are the uvmaps!
How's the debugging going?
Not well. I had a look at it for around an hour this evening and I can't make head nor tail of what's happening. I have reduced the size of the test model I'm using to verify it from 8 to 3 facets so that I can work through by hand and work out where it's going wrong. I hope to be able to spend a bit of time tomorrow evening to work it through. Currently on leave and am trying to replace our garage roof and .. well, it's hard work so I am rather shattered by the evening and not entirely thinking as straight as I should. Will get it done though.
Regards,
Richard.
Roof is rather important! RL first as they say ;-)
Sometimes the problems just just off the page when we come back to them after doing something else for a bit.
Cheers,
Catherine.
I have finally found one bug, and the program works properly with my test model. However, I'm getting an odd out of limits array error on the second surface of any real model I try. The first surface works properly and the saved obj model matches the UV template plot for that surface in DS. The fact that there are many thousands of facets means I can't single step through the program to the error, and printing info to a log file leads to vast swathes of info to wade through. Then you find crucial bits are missing... Anyway am one step closer.
Regards
Richard.
What is a "second surface" of a model? Is that the uvmap part?
In a multi surface model (eg 'building.obj' with wall, door1, windowglass, windowframe surfaces) then the programme is intended to create a separate model for each surface, with names like 'building - wall.obj', 'building - door1.obj', 'building - windowglass.obj', 'building - windowframe.obj'. To create a model with all the surfaces in the same file would be simplicity, it's creating the facet/vertex referencing for each separate file that's currently where the bugs are.
Regards,
Richard.
Glad I asked. We don't need to do multiple surfaces. Face has one surface, face. The lips I need as a separate mesh anyway so I cut that out [using Hexagon] and then it too only has the one surface, Lips.