MEL - Maya UI Building


#141

An unconvenient truth… I’m lazy. I guess I’m not alone…:wise:

So I prefer to spend my time doing the reeel coding. Not inventing all kinds of coding mumbojumbo to create a UI (unless its something special). Most of the time I just need to build an interface made of the basic stuff ( strings/ floats/ checkers/ radiobuttons/ choicelists/ … ) To perform those simple tasks, I think there’s nothing easier than the visual approach.

In 3DSMax building UI’s is a real breeze thanks to the visual approach. I found some stuff for MEL but nothing that’s really good or can match with MaxScript Visual UI builder. MEL exists for 6-7 years now… ? I checked the Mel_UI_Builder1.6 but… To be honest, it kinda sucks compared to what MAX has to offer(although its something:rolleyes: ). There MUST be something of that kind that works really well… ???:curious:

Is there a kick ass visual UI builder for MEL or does it still has to be invented?:banghead:

Thx.


#142

There were a couple of likely contenders but they all seemed to have some major problems.

Lately I’ve been using UIDesigner - which is very clunky but I can knock something out very quickly

I used to use Melanie but it crashed constantly and annoyed the heck out of me because it was a standalone app.

I’m surprised there hasn’t been more development in this area.

==magilla


#143

Thx a lot Magilla.

I’m testing the UIDesigner…

It’s kinda crappy too but I can live with it. The biggest problem with it is the fact that it generates errors in the MEL output code… (commands missing/switching labels and names/ etc). So I need to debug the code and clean it up…

I haven’t tried Melanie yet. (:p). Lost too much time already. But I will. She better be good to me once I do her:wip:.

I’m surprised there hasn’t been more development in this area.

Apparently everybody loves scripting interfaces. It’s the summum of satisfaction. A very creative process. They should organise a contest for who can script the nicest interfaces and publish it in expose…

Can I write scripts with my wacom ??? :bounce: :bounce:

Sorry, I’m just a little dissapointed… Thanks again Magilla.


#144

QUOTE--------

GUI Builder
I’ve put together a mel script that works as an editor for user interfaces. It has over 32 controls in it and 8 layouts as well. I wasn’t sure if this would be the best place to post this but I’ve found this script really sped up manufacturing UI. I’d love to get some feed back on this script and see how you guys like it.

http://www.3dsetup.com/scripts/guiBuilder.mel

Yours truly,
Michael Clavan
www.3dsetup.com
mc@3dsetup.com

QUOTE--------

this tool is really fantastic. not only for production, but as a learning tool. Thanks

craig


#145

well,

i just wrote this ui-builder.
you model the ui-layout in maya viewport. the script takes the maya units and hierarchy to generate the ui-mel-script.
the transformname defines the ui-item type ( window0 e.g. )
and the shape-name defines the ui-item name ( mywindowShape e.g. )
the ui flags are added as dynamic (custom) attributes and can be changed via my ui-generating-ui.

the first attachements shows the ui.
the second attachement is the script…

have fun,

moe


#146

****ing sweet man, well done :smiley:

Gonna give it a go :wink:


#147

How would i update the color of a button in my UI without using a ScriptJob
or updating the entire window?

window; columnLayout;

string $button = `button -label "Color Me"`;

button -edit 

 -command ("evalDeferred \" button -e -bgc 0 1 1 " + $button + "\"") $button;

 showWindow;

works but the update speed is a bit unpredictable. Is it possible?

I am also looking for a way to save presets/parameters for my ui.


#148

hi,

that’s a common problem in maya-ui.
in order to change the color correctly you have to change the text, or an other
parameter ( e.g. height ) as well.

greetz, moe


#149

Very stupid, thanks for leting me know.


#150

hey there…

small question.

if i have a formLayout with three buttons. how can i grey out/inactivate/make invisible button number two (alone without hiding the whole formLayout) ?

thanks…


#151

Hey deadalvs.

Wait a minute…where are we? :scream:

After you’ve created your button, you need to edit the -enable flag, like this :

window -width 150 myWindow;
 	columnLayout;
 		button -label "Enabled" -w 60 firstButton;
 		button -label "Disabled" -w 60 secondButton;
 		button -label "Enabled" -w 60 thirdButton;
 	

button -e -en 0 secondButton;

showWindow myWindow;

#152

now that’s a surprise… :slight_smile:


yeah, since i’m pretty p****d off of the «other» forum, i thought i’d just rewrite my copying script to cool down…

now i tried to work with formLayouts… i think this will be also a cool script ! yay !

thanks for the tip, i’ll use it !


#153

No worries mate :thumbsup: I’m actually just putting the finishing touches on that procedural script. Should be up tomorrow morning, with added MXM/Anim export. It’s a complete b**ch, but should keep people going until 1.2 comes out :smiley:

And form layouts are definitely the way forwards. I usually end up having groups of controls in their own formlayout (for instance, 3buttons.) I then put that layout into another layout, so you can move the buttons as a group, and they’ll keep the nice spacing you spent ages setting up :slight_smile:

Good luck!

Cheers,
Dr Merman


#154

hey guys,

do anyone know how to give a tooltip for a button control? like when u hover on the button it should show a tip of what it’s function is…


#155

good question. this must work because maya’s normal UI does have that funcion too… i just never searched for it though…


#156

you just have to use the flag “-annotation”.
example:

button -label “bla” -annotation “helptxt” buttonName;

the annotation is seen in the helpline at the bottom of the main ui, too.
[size=2]sometimes the bubblehelp is turned off…
[/size]


#157

thanx for the reply maniax… i tried the annotation flag… as u said it comes ONLY at the help line not as a tool tip…and where can i turn on the bubble help?


#158

you should find a checkbox under Window>Settings/Preferences>Preferences|Interface|Help:
Tool messages > enable;
but this is not save anyway. i don’t get any bubblehelp as well.
sometimes it’s there somtimes not…


#159

thanx ManiaX…

you are right… the “-annotation” flag works both for help line and tool tip…if tool tip is not on in the preferences then it shows at the help line other wise we can see it as a tool tip…

thanx a lot…


#160

Hi,

I have written an exporter for Maya a while ago . It uses the Maya API and works quit well, but I would like to make it more convenient for the user.

So everytime the user loads the plugin, I would like to add a panel to each transform node and material node in the attribute editor. With these panels the user can set attibutes that I will store as extra attributes. E.g. the user can select a special shader node the exporter uses, not by adding a string extra attribute manually, but by clicking a preview thumbnail for this shader node.

Can I do this (adding custom panels to the attribute editor), or can the attribute editor only display nodes and attibutes that actually exist ?