View Full Version : Modifying the standard UV Texture Editor

07 July 2012, 01:31 PM
I'm curious if this would be a big project or if it's relativly easy.
I've seen this at least once: I do not remember the name of the script or it's author but (s)he had added an extra window to the UV texture editor containing additional functions.

What I want to do is to add some buttons (function calls) from xForm UV to the standard UV texture editor, as well as some custom buttons (such as rotate 180 deg CW, CCW, and so on). I know how to make a button and a function call in MEL so that part is covered already. What I don't know is how to retrieve the code for the uv texture editor - or if it's available somewhere in the first place.

Anyone know where to start with this?

07 July 2012, 01:53 PM
you can create your own windows and place the UV Panel inside them, but tbh the best and easiest way is to edit the texturePanel.mel script in your Maya install folder (don't edit the original though, copy it to one of your script folders)

this is the MEL script that builds the UV Texture Editor and it's very easy to add your own buttons and shelves to the layouts in it.

07 July 2012, 01:54 PM
Adding new icons into the UVs native tool bar might be tricky. You may want to consider just creating a new window with a layout for your functions that also manages a UV Editor.

Check out "getPanel" and "scriptedPanel" commands (the uv editor is of the scriptedPanel type).

07 July 2012, 04:41 PM
Okay cool thanks.
I'll get back to you when things blow up :applause:

07 July 2012, 05:26 PM
Ok so I took a look in texturePanel.mel

I don't understand where all the GUI buttons are supposed to be in that script.
For example: I did a search for "lattice" in Notepad++ (my text editor) in order to find the UV lattice tool. And sure, I found the menu items and even tried deleting half of them - then reloading everything. That part worked just fine. Deletion and cloning of menu items. But the GUI buttons... it's like they are not even in this script but somewhere else?

One function in that menu script is named (according to comment) "Build Menubar" and consist of textureWindowCreateMenubar($whichPanel, "textureWindow"); and a lot of other code.

To me (a complete coder noob who've spent 15 min looking at the script) it seems that the texturePanel.mel is simply a script for assembling the different parts of the UV-texture editor.

As I suspected, the button layout is in another file called "textureWindowCreateToolBar.mel" - which the textureWindowCreateMenubar -file calls on.
I've tried "destroying" a few things in that script and then load it up so I now know what file to work with :)

I've successfully added my first custom button to the UV Texture Editor: Average UV's along U. Starting to feel like a MEL -boss :D

CGTalk Moderation
07 July 2012, 05:26 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.