thought I’d through a question out about modifying Maya’s native UIs.
For example, I’d like to add a button next to the ‘Create new layer’ button in the Layer Editor window.
I did a search for the string in Maya’s install directory, though nothing with much help appeared to showed up.
Most of Maya’s internal mel will be in C:\Program Files\Autodesk\Maya2008\scripts\
I found Create a new layer in startup\layerEditor.res.mel
displayString -replace -value “Create a new layer” m_layerEditor.kCreateNewLayer;
and then in layerEditor.mel it’s where they add the button
line 340
// Button for creating new layers.
//
$emptyDispLayer = `symbolButton -image "newLayerEmpty.xpm"
-annotation (uiRes("m_layerEditor.kCreateNewLayer")) emptyDispLayer`;
// Tab layout with two children. One for display layers, the other
// for render layers.
//
Hope it helps
You should be able to make a modified layerEditor.mel and put it in your script path and once it sources it should overwrite Maya’s internals
As a test, was able to edit the annotation for the emptyDispLayer symbolButton…
Though looks like it’s not as easy to edit the preceding formLayout $form because it’s not been given a name, so it’s difficult to grab…? $form = formLayout.
Ideally I’d want to create a second symbolButton next to the existing emptyDispLayer button.
Hey, not sure how helpful this is but I had similar issues when customising the timeSliderMenu in that the some of the UI object names were not fixed. It sounds similar to your issue - the formLayout will have a name, it’s finding what it is that’s the problem.
I was adding a menu item to the popup menu when right clicking on the timeline.
A trawl through the maya scripts revealed that the object name for its parent - the playBackSlider is stored in a global variable, but that the object name for the menu is consistent. I could therefore generate my complete UI object string by;
I’ll try and have a go at what you’re trying to do when I get a spare moment, hopefully the above info might get you a bit further but I’ve found that the way the UI is constructed to be sometimes quite inconsistent.
Robert Bateman
05-25-2007, 06:08 PM
You mean like this?
// kill all GUI items under the toolbox form
deleteUI formLayout -q -ca $gToolboxForm;
// and replace with your own stuff
setParent $gToolboxForm;
$b = button -label "HowdyDo!!";
formLayout -edit
-attachForm $b “top” 0
-attachForm $b “left” 0
-attachForm $b “bottom” 0
-attachForm $b “right” 0
$gWorkAreaForm;
Some other useful globals to do pretty much the same thing…
global string $gMainWindow;
global string $gMainWindowForm;
global string $gStatusLineForm;
global string $gShelfForm;
global string $gWorkAreaForm;
global string $gMainPane;
global string $gToolboxForm;
global string $gTimeSliderForm;
global string $gPlaybackRangeForm;
global string $gCommandLineForm;
global string $gHelpLineForm;
global string $gAttributeEditorForm;
global string $gToolSettingsForm;
global string $gChannelsLayersForm;
global string $gMayaLiveControlForm;