Marvellous Designer Quad Mesh in Maya

Marvellous Designer is a great program for designing, editing and to a lesser extent simulating clothing.

However, its biggest drawback is that it only produces non-homogenised triangle meshes, much like the old Maya cloth. (apparently MD have been working on quad meshes for a very long time,.. and Im hearing at least one company has a version of the software with that feature already)

Whilst you can happily simulate with triangle meshes, youd always want to have a quad mesh to work from for numerous reasons- mainly related to selection and being able to subdivide- triangle meshes are terrible for subdivision.

But once I realised that Marvellous Designer produces cloth-space UVs I realised we can have our cake and eat it

This tool generates a decent quad mesh from the non-homogenised triangle mesh .obj files using a user specified fabric space grid density

LEFT: Marvellous Designer produced tri-mesh    RIGHT: result of mdMeshSetup on that tri-mesh



Next, sorry, its quad mesh on left and MD tri-mesh on the right!




Shaded, the quad mesh is a clear improvement. Again, quad mesh on left.




The process is automatic.. This took about 2 minutes to mesh using my script, or 30 mins by hand!!

Here's how its done:
  1. find all UV shells in the MD mesh
  2. move all shells away from one another to create a bit of space in UV space
  3. separate faces within a UV shell to their own mesh ( so each panel is now a separate geo, keep a copy of these separated models)
  4. move the vertices' XYZ coords to be U,V,0 (all the panels will be laid out flat now, as if in the MD panel editor)
  5. now, make a big plane (nice high res) in the Z axis that covers all the panels (We'll use each panel like a cookie cutter to cut the big plane to the shape of each panel) - actuyally, make it a cube so it will boolean properly
  6. poly extrude each panel a short distance so it cuts across the big plane
  7. boolean intersection a copy the big plane with each panel
  8. delete unwanted faces by deleting any that are in the -Z (now you'll have the quad panels cut correctly in the shape of the tri mesh, but flat near the origin)
  9. now create a wrap deform the quad mesh to the tri-mesh (actually, dont, use Transfer Attributes)
  10. now create a blendShape from the tri-mesh in UV space to the one we left a copy of in step 3
  11. set the blendShape target to 1, and the wrapped quad mesh should follow it to the correct place in 3D!
  12. Finally, combine all quad mesh panels together into one mesh
  13. delete history
  14. sew touching edges using my script 
  15. Adjust the poly mergeVert node's distance until all edges are sewn together very nicely :)
-or-

run mdSetupMesh()

which will perform all 15 steps above :)



Considerations:

You can see along the edges, the "fabric cutting" process results in perfectly quadrilateral results where the rest edge lengths are identical across the entire mesh, but nasty 3->5 sided polygons are produced. 

Before you sim, make sure you triangulate.. it may seem insane untriangulating a mesh, then retriangulating it, but the reason we want a quad mesh isnt really to do with creating a good sim mesh- its about making decent mesh we can render with that can be wrapped onto the sim mesh. You may wish to clean up and >4 sided faces, eitther by hand or by using mesh->quadrangulate before you subdivde or model any further detail in to the render mesh
The result above will subdivide about as well as possible, and will sim well when triangulated too


To download... wait a few days.. im combining the mdMeshSetup() function with the sewMeshEdges() function.. wont be long :)


Ive written a GUI for the scripts.. hold tight and i'll upload the new version very soon

ċ
avMergeMeshEdges.py
(5k)
Adam Vanner,
6 Oct 2012, 11:19
ċ
getUVShells.py
(2k)
Adam Vanner,
6 Oct 2012, 11:19
ċ
mdSetupMesh.py
(4k)
Adam Vanner,
6 Oct 2012, 11:19
Comments