This is a Maya mel script I wrote to automatically create Selection Sets for UV islands in UV shells of UV mapped polygonal geometry, for export to Mudbox (which supports Maya's Selection Sets). This way you can easily select UV islands in Mudbox to Hide/Unhide/Remove etc. to speed up your sculpting workflow.
NOTE: Tested with Maya 7&Mudbox 1.0.4 rev 1760 on Windows. Should work with Maya 8 & Maya 8.5 as well (though not tested)
Just to clarify some terminology:
- I use the term "UV shell" to indicate a UV map that isn't empty
- I use the term "UV island" to indicate a smaller, self-contained section of a UV Shell.(1) Installation:
(a) Unzip the uvIsland2selSet.mel script to your mel scripts folder (consult your Maya docs if you don't know the location)(2) In Maya:
(b) Unzip the i2s_32.bmp icon to your icons folder (consult your Maya docs if you don't know the location)
(c) Make a Shelf button that sources the script and icon (consult your Maya docs if you don't know how to do this)
(a) Load a scene that contains one or several polygonal models where:
(b) Click on the blue i2s icon you created on your Shelf to begin the process.
- the geometry is as cleanly built for eventual export to Mudbox as possible
- each piece of geometry has no parents and no children, and is essentially its' own single node hierarchy
- each piece of geometry has been UV mapped
(c) A Progress Bar will start, with more complex models taking more time to complete. ESC to stop the process (any garbage left by escaping is cleaned up). (Fig. 1)
(d) When complete, each UV island in each object's UV shell will have a corresponding named Selection Set generated. To see this, you can look in your Outliner (Fig. 2), or optionally (and preferably), you can use (e), below. The "_i_" is for "island".
(e) A uvIsland2selSet Window opens upon completion (Fig. 3), which contains the following for each poly object in the scene:
- The Name of the object (as a header for a collapsable Window Frame, click the arrow to the left to collapse)
- The Number of UV islands found in the UV shell for that object
- The Time at the start of and at the completion of the detection operation
- Export button, to export the model with selection sets (launches the Export Selection Options window, make sure you set to OBJ export with Groups toggled ON and Point Groups toggled OFF)
- A List of the named Selection Sets the script created. You can:
- click on one of the buttons under 'Pick a Selection Set' to select & highlight that set
- type a new set name suffix (to something other than the automatically generated incremental numbers) in one of the corresponding fields under 'Modify Set Name'
- click a 'Click To Modify' button to commit the change to both the Selection Set in the scene and the Selection Set button in the Window (Fig. 4)
(3) In Mudbox:
(a) Import the OBJ file(s) you saved out of Maya
(b) Click on the Object List. You'll see (Fig. 5):
(c) Hide/Unhide/Remove/etc. while you sculpt
- A slightly renamed version of your model Object, right click and choose Rename Object to correct it (this has to be done because Mudbox parses the OBJ file to get the model's basenode name incorrectly it seems. A small problem.)
- All of your named Selection Sets (modelname_i_ <whatever> modelname -- the posted image shows the default Selection Set names with default incremental numeric names exported from Maya)
Hopefully it works for you & you find it useful! Feedback is appreciated.