Maya: UV Texture Editor Extension

The default UV Texture Editor that comes with Maya is… sad. Sure you can do things with it, but there are some great extensions out there that can add to your workflow. I’ve used a few of them, but I really only “need” a few extensions to really get the job done. While those found freely on sites like Creative Crash are fine… they usually also try to cram in so much stuff … things I just don’t use or need.  I found a few that fall short when it comes to handling scenes with references and editing large numbers of UV sets on multiple objects. So in this article, I will share a quick and easy extension I created to help solve that issue.

The Original

The default UV Texture Editor in Maya has the core functions needed and looks like the following. I have yet to install 2016, so the icons may have changed now, you get the idea.

Figure 1: Original UV Texture Editor

Unfortunately, in order to know which UV sets you have open and are working on you either need to keep the “UV Set Editor” open, which is a modeless window and gets hidden often, or continuously pull down the “UV Sets” menu option in the editor (the current set is checked). This is a pain. Up until Maya 2014, I used the Nightshade UV Editor (found on Creative Crash), and it worked well:

Figure 2: Nightshade UV Editor

However, there were times when editing I had no clue which object uv set I was working on if I had selected multiples in the parent editor window. There was also a strange UV Set bug that would crop up once in a while that would destroy the sets and replace them with an empty default “map1”. That was always fun. I was never really certain if it was a Maya bug, or something in the procedures from Nightshade… either way, to work-around it I had to continuously clear out my editor history (I still do this btw). Regardless, a cool tool, but it had many options that I just never used, and wasn’t compatible with Maya 2015 (I think he has an update though now). So I set out to extract only the tools I used regularly and compress them all onto the single toolbar of the original editor window.

 

 

Customized UV Texture Editor

Here is a shot of the editor I created. I extracted a few of the procedures found in Nightshade’s editor; however, the point of this post are related to the text lists on the far right of the toolbar. An active object and UV Set list. I use multiple monitors, and customized the layout to fit a 1920 x 1040 display. It works for me.

Figure 3: Customized UV Texture Editor

 

When editing multiple objects, those objects are listed in the “Object List” along with all of their UV Sets in the the “UV Sets” list. This works nicely with scenes that use file references, and you can quickly see which sets you are working on in the editor and to which objects those sets belong to… they’re highlighted in bold font. (too bad we can’t use colored fonts)

 

Figure 4: Quickly find UV Sets for an object

 

When working in component selection mode, you can now tell which set from the glob of sets you have open that you are selecting in the editor:

Figure 5: Component Mode and Visible Sets

 

The Code

I’m providing a copy of the Maya original MEL script with only the code necessary to add the two lists. There are no icons or dependencies required to get these to work. All you need to do, is backup the original “textureWindowCreateToolBar.MEL” script in the installation directory of Maya (found within the C:\Program Files\Autodesk\Maya2015\scripts\other directory, unless you’ve installed Maya somewhere else). Then copy the script extracted from the zip file (found below) into the same location. If you already have Maya running, (close the UV Texture Editor if open) simply open the script editor window, and execute the command “source textureWindowCreateToolBar;” to load the new source.

Launch the UV Texture Editor, and you should now have something like the following:

Figure 6: Original Editor with new source

 

The Gritty

There are three procedures added to the script (found around line #610) which are: selectedObjects(), uvQuickSetEditCmd(), and updateSelectionList(). Inserted near line #2210, are the layouts for the textScrollLists, and finally there is an addition to the eval() list (at the end) and a few scriptJobs to keep the lists refreshed when selecting objects or groups. I won’t go into much detail on the code, but I worked it up over the weekend, and tested it on several scenes. So far, so good. If you are interested in seeing how to use unique tags for textScrollLists, take a look at the changes I made. J

Just to note, there still at times seems to be strange bug that crops up in Maya when copying UV Sets that resets them to a default “map1.” I’m not sure if this is due to the fact that I’ve been loading many old scenes and making corrections from previous Maya versions, or if this is just the nature of the beast for Maya. A very simple workaround is to be sure to clear your edit history “before” making the copy of the UV Set. I know this is not related to my editor extension as I do not mess with the UV Set names nor are there any option tools for copying the sets… that all happens using the native and original Maya tools.

What exactly do the lists do?

  • When selecting an object in the “Object List”, it’s UV Sets are highlighted in the “UV Sets” list.
  • You can multi-select objects and all related uv sets are highlighted.
  • You can quickly change the current or “active” uv set to work on for an object by selecting it in the “UV Sets” list.
  • You can easily see which UV Set you are working on if you are in component mode (CV, UV, Face, Edge) and have one (or more) components selected in editor, the sets are highlighted 🙂

One minor glitch I’ve noticed is that while in component selection mode, if you try to change the active or current working uv set for an object by selecting it in the list, there a minor flicker on the list refresh.  The set does become active, it just looks a little weird.  [fixed: 07/02/15]

 

The Script

You can download the script from my OneDrive here: http://1drv.ms/1dzwSdk

 

Enjoy! And let me know if you have any questions are issues…

Advertisements
Tagged with: , , , ,
Posted in 3D Graphics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: