Jump to content

Need help to convert MD meshes from tris to quads through Adam Vanner's scripts


Marinshe
 Share

You are about to reply to a thread that has been inactive for 3708 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! If someone have ever dealt with Marvelous Designer meshes and Autodesk Maya, I need your help with the set of Maya scripts, purposed to transform triangular MD meshes to quads. Like some people here, I found this set from Adam Vanner here - https://sites.google.com/site/adamvanner/scripts-and-tools/marvellous-designer-quad-mesh-in-maya, but cannot use it properly (I try to do it in Maya 2013 x64). The scripts were written before October 2012, and I think they should work in Maya 2013, and I found two recent threads on this forum, where users wrote they had a success with the scripts. Especially here (http://community.secondlife.com/t5/Mesh/Tris-to-Quads-using-Autodesk-Maya/m-p/2558484/highlight/false#M26417), the user Zlyskritek wrote - I have followed the thread and succesfully prepared a quads mesh, however the border edges are not sewed together.  As for me, I cannot get any proper mesh yet, cause I don't know how to use these scripts right.

When I try to use it on the usual MD welded mesh, I get the same error, which was mentioned here - http://community.secondlife.com/t5/Mesh/Maya-Boolean-making-mesh-vanish/m-p/2462669/highlight/false#M25526-

Error: line 1: TypeError: file C:\Program Files\Autodesk\Maya2013\Python\DLLs\mdSetupMesh.py line 92: Object [] is invalid # The line 92 is: cmds.delete(toDel) in the MakePlanarMesh function:

And all that looks like this -

http://i33.fastpic.ru/big/2014/0403/31/e978b8e00682b8700fb49ae0b5265231.jpg

That is the script mdSetupMesh cannot generate all 6 blendshapes for the parts of mesh

When I use it on the same mesh but exported unwelded, scripts generate 11 blendshapes instead of 6!

http://i60.fastpic.ru/big/2014/0403/81/bd15933b0dd394a04043e677a1934881.jpg

Following advice from one Maya forum, I changed the line 92 to

if toDel:

cmds.delete(toDel)

But it didn't help at all, the same result. How to use these scripts properly and get a normal quad mesh? And how to wrap quads around blendshapes - at first I should pic quad flat meshes, then tri flat meshes, then Create Deformers - Wrap? And where is that option in Maya 2013 (or Maya in general) to change 0 to 1? (I'm not quite familiar with Blendshapes and wrapping yet).

Another question I have - there was a plugin on that site too - https://sites.google.com/site/adamvanner/scripts-and-tools/avmergeedgescmd, with two files - .mll and.cpp. Where should I put these files in Maya's folders to make the plugin work? And how to use this plugin to sew the border edges precisely?

If someone knows the answer, I would be very grateful to learn it from you. Though I don't make clothes for SL, I plan to make it for DAZ and Poser and have the same problems with meshes from MD (and I dream of the day they will make a new version of their sofware with export in quads). Meanwhile this day hasn't come yet and these scripts seem to be the best retopology tool for MD meshes I've found. And your forum seems to be only forum in the web where some people happened to use Adam Vanner's scripts on these meshes.

Link to comment
Share on other sites

Hi Marinshe.

There is a tutorial that you may want to watch to convert tris to quad in maya  for meshes done in clo3d or in marvelous designer.

It's easier than you could belive.

I used tomake my tests that video and the new retopology tool from maya 2014 as shown in the link that you posted too

http://community.secondlife.com/t5/Mesh/Tris-to-Quads-using-Autodesk-Maya/m-p/2560238#M26454

However I just tried a few times marvelous designer.

in my opinion it's good to get a quick scratch to work with to model your definitive dress, but not to upload the mesh as they come out from it.

1) cause as you're already asking to, it needs a good topology for next steps

2) cause the mesh as it comes from clo3d or marvelous designer has a very very huge number of polygons(justifable before normal maps but now surpassed meshes and laggy)

In case you want to try an alternative way to build your retopology model from the scratch got in clo 3d or in marvelous designer, you could use zbrush it has in the last versions a few retopology tools not bad at all very quick too.

The best practice now is to make your model modeling tecniques a very basic with the lowest number possible of polygons dress or in alternative to use marvelous designer but then use retopology and polygons reductions tools (like those  in maya 2014) play a lot with normal map rather than using the displacement method that marvelous designer is based on.You do good looking for a retopology method, that's first start to also reduce properly polygons.

This is what will make your clothes competitive compared to the old ones ( pre-normal map era) and low lag products as well.

maya 2014 has nice improvements for the retopology tool as you can see from that video in the other post I linked here. maya 2015 has also other imporvements for building tools to speed up the workflow.

About the sculpt programs that I prefer in Zbrush, it  is the best in my opionion to sculpt in 3d on models and make your normal maps in 3d.

 

As cheaper alternative to zbrush there is also 3dcoat or Vota (but not as good as zbrush).

 

Still about retopology you could rebuild your mesh again also not using zbrush or maya , just use any other software that would allow you to draw polygons and use the snapping, snapping  the new polygons that you make to faces and vertices. i this scenario for retopology ( even if  bit longer and tricky) you could use blender too.

Link to comment
Share on other sites

Thanks, Astrid! The technique from video is also good,(I came across this video even before I found this forum), but I couldn't master it,- every time I tried to get Boolean intesection of extruded flat meshes, they disappeared, that's all. After this I found Adam Vanner's site and the scripts and by now I managed to make it work, though partly. As I found out, the mesh must be separated before using the scripts (Mesh - Separate) and for every part of the mesh I had to run the scripts separately too. That is I pick the first part (front), then copy the command to call the scripts into the Script Editor -

import avMergeMeshEdges
import getUVShells
import mdSetupMesh
mdSetupMesh.mdSetupMesh()

Then, after running, the script generates blendshape1, then I pick the second part of the dress and repeat the same action until I get all the blendshapes. Not so fast one-click decision, as the author has promised, but it's the best and fastest decision for me - it makes ready blendshapes. Though some of them after wrapping in the end work incorrectly, producing distorted shapes of the new mesh, but I guessed to use Transfer Attrubuites instead of wrapping quad meshes and it works fine! I found out I need to transfer UVs from the flat triangular meshes to flat quads -

Transfer UV 1.jpg

And then I transfer the vertex positions from the corresponding part of the original MD triangular mesh to its flat quad twin.

Transfer vertex2.jpg

After this I got finally the quad mesh with very good (to my noobish mind) quad topology, though it's still more high-poly (about 10000 polys against original 5780). Maybe there is a way to reduce quads without distorting the mesh? (I wanted to do it through standard Maya Mesh -Reduce, but this tool generates nice edgeflow in the middle regions of the meshes, but  with ugly jagged borders).

Now I'm looking for a way to make the last script to work - avMergeMeshEdges.py. I tried to run it alone, but no luck, it doesn't respond at all. I tried the plugin avMergeEdgesCmd.mll  but cannot manage with it too. When I call it by the command

avMergeEdges();

select the mesh,

I get just the message

# Error: line 1: invalid syntax #

Though it's installed in bin\plugins folder and listed in the Plugin Manager. What is this - the error in the text of the plugin?
The mesh I try to use it on, consists of separate parts, just as A,V. said on the plugin's page (the same mesh I got thri Transfer Attributes). Definitely, if there was a way to make the scripts usable, there may be a way to do the same with the plugin. (The file .avMergeEdgesCmd.cpp, as I learned lately, is written for the people, able to re-compile it for Maya 2013 x64, so does it mean the plugin itself is not purposed for this Maya at all?). I don't think I will be ever able to recompile plugins, so I hope to use the last script avMergeMeshEdges.py  to make it work independently. I just began to use scripts in Maya but I see they can make the life much easier, if used right. If anyone knows how ho make the last script workable in Maya 2013, maybe you prompt me what to do with it or to change within it?

As for 3DCoat and Vota, I've seen some videos about auto-retopology in 3D Coat and it impressed me much, but as I've heard, 3D Coat works so well just with solid models like human figures etc and requires to close all holes in the mesh (I wouldn't want to fix closed holes in the clothes). And MD offers me the faster and more creative way to make clothes, even layered clothing, when you can load in a blouse as avatar and to make an excellently fitted vest over it, so it may create whole sets of clothes.So I'm fell for MD, so-to-say and maybe I'm too lazy to model clothing in a classic way. Maybe I think as a noob, but Maya produces not the worst edgeflow, saves UVs and works really easy and fast.

Link to comment
Share on other sites

if I read well "avMergeMeshEdges.py" that script is not mel but python?

if so try to switch from mel to python in the left bottom corner of maya. where is written mel clicking on it  you switch to python and viceversa clicking again you go back to mel.

see if this could make that script run properly.

Link to comment
Share on other sites

Hi there,

I went through this a week ago and ended up at this moment. There was no way to make the second script work.

I also found this site in French, where there is an updated version of the scripts, but still no luck.

http://baptiste-roy.blogspot.cz/2013_12_01_archive.html

 

Actually I tried also Zbrush with the retopology Zremesher and UVmaster tools. But even if you keep the individual parts as polygon groups, I never got such a nice UV layout as from MD. The reason is that clothing is not a skin, I want to keep seems where they should be and in that shape.

 

The last and most promising to me is this way. For sure, it is not the technically most optimal solution, but it could work for my purpose.

http://www.marvelousdesigner.com/community/forum/view.aspx?messageseq=4298

 

Have fun and share your findings :-)

Kaithleen

Link to comment
Share on other sites

Hey I was just wondering when you export out of MD do you export out with the scale set to meters?  Do you export out as a single object or multiple?

I ask about the scale because MD mesh is way bigger than SL scale and exporting it out as meters it shrinks the mesh.  I know in Maya Boolean and other functions Maya can error out when vertices get too close.

If you been exporting you MD mesh out with a smaller scale like meters try exporting it out as a bigger scale and then import the OBJ into Maya and run the scripts.  See if that works.

My version of Maya is too old and I can't run the scripts so I have to do everything manually.  I kinda came up with my own method that is a combination of what the scripts do and the what you see in the video here. 

 by CreatMesh.

I export out the same way as in the video though in the export window I select the "Multiple Objects" option when exporting each OBJ.  So I export both the mesh clothing as a 3D mesh and the UVs as a flat mesh separately.  If the mesh imports into Maya as a single object it is no big deal to separate them.

I don't use the extrude and Boolean method.  I use Blend Shapes and Wraps which is what the scripts use.  See I use the 3D mesh and the flat UV mesh and create a Blend Shape so that the flat UV mesh changes shape into the 3D shape.

While the UV is still in its flat shape I either use Create Polygon Tool and has snap to point turned on and create a polygon by clicking on the corners or all the vertices around the edges of the flat UV mesh.  Then I can use the split polygon tool and other tools to create the internal edges and vertices.  This is not my favorite way of doing it though.

My Favorite way is to, while the UV mesh is flat and with snap to point turned on use the CV curve tool set to Linear and I then click on one of the edges of the UV mesh and create a curve that matches the edge perfectly.  Then I do the same for the opposite edge making a second curve.

Then I select the two curves and do a Loft creating a polygon quad mesh in the shape of the flat UV mesh.  This makes for really nice edge flow.  I then create a proxy object from it.  I then select the proxy mesh and in the Channel Box under OUTPUTS change the Liner Level from 1 to 0.  Now my proxy object has the same exact vertices and faces of the original.  I will tell you why I do this later.

I then move the proxy mesh so it is in the same exact place as the UV mesh.  In the Outliner I first select the proxy mesh hold down the Ctrl key and select the flat UV mesh and create a Wrap.  I then select the flat UV mesh and change the Blend Shape setting in the Channel Box under INPUTS from 0 to 1.  This makes the UV mesh change shape into the 3D meshes shape and in doing reshapes the Proxy mesh into the same 3D shape. :D

Now I use a Proxy mesh because you can use the original Lofted mesh to edit the Proxy mesh.  You can move vertices around the Lofted mesh and the Proxy vertices will move following the 3D shape as long as when you move the Lofted Mesh vetices they are still flat.

You can do other things like change the INPUTS settings of the Lofted mesh in the Channel Box and they will automatically be applied to the Proxy but they will follow the contours of the 3D mesh.  YOu can add vertices or insert edge loops to the to the Lofted mesh and they will again automatically be applied to the Proxy mesh following the contours of the 3D shape.

If for each flat UV mesh you do this and make sure that the edges of the Lofted mesh have the same number of vertices most of the time the vertices match up perfectly along the seams and will merge nicely.

It may take you 30 minutes to an hour to do an average outfit this way but what you end up with is a quad mesh with really nice edge flow.  If you really want the same UV pattern as the original MD UVs just do a planar mapping of the flat Lofted mesh.

Once you get all the different sections done just duplicate the proxy mesh to set the shape and you can then combine and merge all of them together.

I hope that helps someone. :)
Cathy
 

 

Link to comment
Share on other sites

Hello, Cathy! I use Marvelous Designer (3) to make clothes for DAZ and Poser figures and so I'm limited to DAZ and Poser scale measurements. For Poser it's 8,6 ft (0,038149%), for DAZ Studio it's centimeters(10,000%). It guarantees me that clothing will fit the very avatar for whom I model it. I don't familiar with SL scale, but scaling to meters is equal 0,100000% (it seems really small, indeed). Usually I export all meshes as single objects (and Adam Vanner's method requires them to be welded). But as I made sure now, on the welded mesh his original scripts don't work, so I have to export the mesh unwelded, then do Mesh-Separate and run scripts on every its part.

By the way, lately I found the updated version of mdSetupMesh.py from the French blog - http://baptiste-roy.blogspot.cz/2013_11_01_archive.html. (big thanks to user marcuswilm from MD forum, So far I could not make it work too in Maya 2013 but it shows the window Exode Md to Cloth at least and maybe I'll have luck with this script, Here is it - https://gist.github.com/anonymous/7748253#file-mdsetupmesh_custom and shown as text on that blog page. If someone needs that script too, just save it as .py file, maybe someone will be able to run it (I guess it's updated for Maya 2014).

The method with creating curves and proxy mesh is interesting too, thanks for sharing! Though today I lack skills in maya to use it, but I hope to learn Maya deeper and then it may became the easier way for me.

 

Link to comment
Share on other sites

Thanks for the info and links Marinshe! :D

My method of retopolizing mesh using Blend Shapes, Wraps and Prox Mesh can be used to retopo more than just MD clothes.  It can be used to retopo just about anything.

You just take your mesh you want to retopo and cut it in half so you end up with a front and back or top and bottom.  Then duplicate the meshes and flatten them making sure there is no overlapping vertices.  Then you basically follow the same steps I indicated for MD mesh.

My method works particularly well on MD mesh because the Flat UV mesh is already laid out in a friendly way with no overlapping vertex and evenly spaced so half the work is already done for us.

I hope if not you someone finds my method useful.  It really does create a much superior quad mesh it just take a little bit more time and effort but worth it in my opinion.

Please keep us posted and  up to date on your progress. :D

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3708 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...