PDA

View Full Version : How important is GUI to you?


Mikademius
01-01-2006, 03:36 PM
There are two ways to script a script. "Fast and ugly" or "slow and pretty". I don't like the defaults in Maya so I create Icons and custom buttons etc. But does the public really care? If I download a script I need, will I bother about an ugly UI? The script executing the commands it's supposed to should really be enough shouldn't it?

No, I actually care about how the script looks. I find it more plesant to work with a script with a pretty UI. I know it's a disease, but I can't get out of it.. :scream:

Also when I script my own scripts I use photoshop to plan out the UI and I also tend to use formLayouts to get total control even though this is more timeconsuming.. I guess I could script twice as fast and efficient if I just skipped the graphics and just used rowColumn, but I can't help it. I like designing a good looking script ( at least a script I think looks good )

Are there other MEL-brothers like me out there or are all of you "fast scripters"? I guess people with programming experience tend to do it the fast way and people that started MEL because of Maya tend to care more for the UI. I'm not saying that applies to all people, but that's how it is at work at least.
:shrug:

Nicool
01-01-2006, 04:45 PM
Personnaly, I'd rather a function oriented script (like I launch writing thisIndependentFunction($var1, $myParameterTwo) ) than a silly pseudo tool with dumn UI.

What's is good ideed, is to have a non-gui step-by-step script. First, select your objects you want to apply the script, then launch the script and it may ask you (through dialog box) how to behave if the user choice is required at this step.

rokandic
01-02-2006, 08:20 AM
I personally tend to make simple UI's, meaning that they take the least amount of screen space and with lowest number of buttons & other UI elements as possible. UI cosmetics isn't important but readability should have top priority. If you're making complex scripts with complex UI's you have to make sure buttons are positioned for users to make sense. For instance if you have some mirror tool, it's not wise to label all buttons with "left", "right" but rather split the UI and the user automatically sees all UI elements on the left as 'left'.
Fancy button icons I try to avoid unless they save UI space and make sense. If their only reason over regular text buttons is cosmetics I never use them.
Also what Nicool has already mentioned sometimes UI isn't necessary at all. If user is only required to make a selection and run the script, UI's are not only unnecessary but can also slow the user down since he must click all the buttons instead of just selecting and running the script.

-rok

M.E.L.
01-02-2006, 10:23 AM
Can't stand UI's... whether it's making them or using them, it drives me nuts. If I absolutely have to then I'll make one, otherwise I make it so all my scripts either prompt for input or simply interact with other existing scripts and build that way....

-s

Mikademius
01-02-2006, 11:01 AM
Yes. Of course you have to consider where to have your UI elements if necessary at all.
I agree that a script that does not require any UI should not execute any UI and simply be a shelfbutton or markupMenu item.

It seems like I'm alone on liking GUI so far :) hehe

zhenyang
01-02-2006, 11:20 AM
Me too me too :)

I like GUIs, and I can't stand "ugly" GUIs: badly aligned/placed controls, wrong colour usage, etc etc (maybe because I'm also a graphic designer, I don't know). When I do programming, I tend to do what very few people here call the "Microsoft-layout" (you never find a badly designed Microsoft GUI, right? :curious: )

thematt
01-02-2006, 12:53 PM
I personnally can't stand GUI! to be really honnest I don't really know how to program one, it's so time consuming..but I should learn because ther are nice sometime, it's just that I write script mostly on emmergency and need them fast fast, so GUI are rarely an option.

BTW are there any good ressource for GUI in mel? I have books (mel script for anmators, and maa programming) for script but there aren't that good for UI.

cheers

Nicool
01-02-2006, 03:20 PM
Mikademius : If you code function oriented scripts, I've scripted an automatique ui buidler. It parses your main function and outputs teh code string of a typical ui specific to your script : http://ndhaussy.free.fr/melScript/uiBuilder.mel I think it's great, but I'm not quite sure if lots of people use it (and don't understand why if it's not a question of communication)

Mikademius
01-02-2006, 06:12 PM
zhenyang: First thing I did in XP was to eliminate the XP skin ;)
Glad there are more GUIpeople out there.

thematt: I also have to write scripts at work in a very short ammount of time. We're talking minutes here. Then I ignore everything that has to do with GUI. If I can avoid windows at all, why not... Then again I have to concider if the reast of my team could benefit from using it. It's nice to have a simple UI at least so they can understand what the script does. And if the script need user input a UI present is not that bad. About good resources for GUI in MEL. I don't know, but you can get pretty much info in the help files browsing, layouts and controls... Even though you don't need a specific control you should read through it. It's nice to know what the different elements are good for.

Nicool: Could you show me your script with an example? And btw: I really like doing GUI so I don't want no machine handeling it for me really ;) Just wanted to start a discussion and see what other people felt about the subject.

Nicool
01-02-2006, 07:01 PM
1 - Let say you've coded a funtion like

proc myFunction(int $var1, string $var , float $whatever) {

...;
}


2 - Load uiBuilder.mel and write buildUI "myFunction(int $var1, string $var , float $whatever)" in the command line.


It parses myFunction arguments and outputs the a relevant GUI code string. That's easy and quick. Then you can work from what this simple GUI to make it better if you want to.

Can you please try my script and give some feedback?

Winner
01-02-2006, 07:17 PM
i think this is interesting.... but on the whole a pointless argument.

A script only needs a UI if it needs a UI.... otherwise whats the point ?

dont forget what a UI actually is... its generally a way for the user to use the tool in a more `human` or overall quicker and more efficient way.

having said that ... im not one for typing crap like this into the console:

aDumbLazyScriptWithAStupidCaseSensitiveName "pCube1" 2 4 "something" 4.667776 "yes"

Mikademius makes a good point: its all about who the script is for. If you intend your team to actually bother to use your script, then dont make it rocket science....

Mikademius
01-03-2006, 12:06 AM
Nicool:Didn't work with this:

proc myFunc (string $name, float $pos)
{
polyCube -n $name;
setAttr ($name + ".tx") 5;
}

myFunc martin 5;



buildUI "myFunc (string $name, float $pos)";


Will you need "int $var1, string $var , float $whatever" or can you use anything?
This is why I asked you for an example. I'm not sure if I understand how to use it...

I didn't get any errors, just couldn't get the window to show...

Winner:
aDumbLazyScriptWithAStupidCaseSensitiveName "pCube1" 2 4 "something" 4.667776 "yes"

Hehe, you said it. We pretty much agree here :)

PhillipCrond
01-03-2006, 02:34 AM
For me, it all depends on who's using the script, and what's faster and more elegant. I have a graphic design and usability background, so I'm always thinking about the laws of usability, and counting clicks (this UI takes 4 clicks and 3 mouse movements to accomplish task A, this one takes 2 clicks with a higher likelihood of the mouse standing still). If you can avoid having someone lift their hand off the mouse to type with both hands AND make your script every bit as functional, then where's the problem with a nice UI?

Nicool
01-03-2006, 05:33 PM
Mikademius, why don't you test it :banghead: It works with whatever function, no matter argumetns and arguments types you have (some particular arguments are not supported for now, like arrays arguments)

Mikademius
01-03-2006, 07:22 PM
I did test it with the code I gave you above... It didn't work? What did I do wrong? Do I have to go global maybe?

thematt
01-05-2006, 04:56 PM
Hey looks like something usefull but me neither couldn't make it work..don't really get how to use it.

IF you could provide a simple working exemple that be great, thanks.

Mikademius
01-06-2006, 09:24 AM
The reason it didn't work with my small proc was that the script made the name "myFunc UI"
It didn't manage to execute the showWindow command. When I changed the name to "myFunc_UI" it launched.

Very nice UI script you have made there. A timesaver for those who quickly want to layout the GUI :)

http://www.final3.com/images/temp/myFunc.jpg

thematt
01-06-2006, 10:16 AM
I still can't make it work..problem using maya6.01.

can you give a working exemple, I'm intersted.
thanks

Mikademius
01-06-2006, 10:53 AM
If you use my example from the previous page you can get it to work by copying the layout code the layoutscript generates. Then rename "myFunc UI" to "myFunc_UI" throughout the whole code and run it.

- write and execute the proc. (I made it global, don't think you have to?)
- execute the whole layoutscript
- execute the "buildUI" command
- Grab the GUI code
- Rename
- execute your newly written code

That should do it.

thematt
01-06-2006, 01:13 PM
oooh?? it does make a gui code..ok didn't see that, i was expected the gui to pop up, and was thinking that it was too bad it didn't write the code.

Will check it out.
Where does it print the gui code?, I don't think i've seen it in the script Editor.
Could be wrong didn't look for it.

thanks for the head up though.

cheers

Mikademius
01-06-2006, 01:25 PM
I think it is supposed to get it to pop up, but it doesn't do it because it's not able to execute the showWindow command...

The GUI-code is the last piece in your scripteditor after executing the buildUI command.

thematt
01-06-2006, 04:46 PM
I think it is supposed to get it to pop up, but it doesn't do it because it's not able to execute the showWindow command...

The GUI-code is the last piece in your scripteditor after executing the buildUI command.



Weird it surely doesn't work here only show me that
//---8<-----------------------------------

no UI, or whatsoever..I guess i'm dumb :)

thanks anyway.

cheers

Mikademius
01-06-2006, 05:12 PM
Now I know why mine didn't work. I had a " " in the buildUI command so it created myFunc UI and not myFuncUI :) hehe:
Here's how it works:

http://www.final3.com/images/temp/procExec.jpg
http://www.final3.com/images/temp/copyRan.jpg
http://www.final3.com/images/temp/genUI.jpg
http://www.final3.com/images/temp/copied.jpg
http://www.final3.com/images/temp/done.jpg






You can also use runBuildUI to get the window to appear at once.

thematt
01-06-2006, 06:35 PM
yep it does work at home but not at work..weird..


thanks for the big tut :), very cool to take the time to do that.

and cool script nicool.

cheers

swardson
01-08-2006, 05:20 AM
It really is all about what tool you are making and for what purpose.

Some tools I have made would be hell to use if it were simply command line driven. While some have been better as single command driven I generally prefer a GUI. Could be the graphic designer in me as well.

I think the biggest thing in all of computers and CG is do everything for a reason. If there is a need or want for something, then there is a need. But dont spend hours of your life creating a perfectly expandable gui that has n number of buttons and sliders just to set a few attributes and connections.

productivity = functionality

-Brad

Nicool
01-14-2006, 10:14 AM
Than you Mikademiusfor making a guide for my little script (even thouh I though a step-by-step wasn't necessary). I galde you get now how my helper can be useful (as a base for coding your GUIs or simply to as a quick GUI for your scripts). I'd like more people to know and use my script :scream:

Mikademius
01-14-2006, 10:24 AM
Yup, it's pretty straight forward, but many people don't read the info inside the scripts... :applause:

Including me this time.... :argh:

CGTalk Moderation
01-14-2006, 10:24 AM
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.