PDA

View Full Version : How to create a bin with mel?


Nenox
08-31-2005, 02:33 PM
Hi.

Need to create bins with a script i'm writing. Can't find any docs on that and the feedback in the scripteditor is not there or useless..

I'm on Maya 6.5

Any help?!

Thank

Sphere♥
08-31-2005, 07:53 PM
What do you mean by "bins"? Trash bins? Can't you just do one with the UI then use the commands generated to base your script?

zylphyr
09-01-2005, 09:59 AM
the bins in maya seems to be just buttons on a layout (normal UI mel scripting), so you could basically script your way there. However, a faster way there would be to use:

hyperShadeCreateNewBin($gridLayout, $binName); //this is a proc and not a command

You will have to give the name of the gridlayout and a name for the new bin.

so this will produce a bin named "test": hyperShadeCreateNewBin "binsGridLayout" "test"

-z

slinkyman
09-01-2005, 10:11 AM
Hi.

Need to create bins with a script i'm writing. Can't find any docs on that and the feedback in the scripteditor is not there or useless..

I'm on Maya 6.5

Any help?!

Thank

select materials etc then;

binMembership -add newBinName;

If the bin doesnt exist it will create a new one. Oh.. you will need to click off the bins tab and then back again to see the new bin.. doesnt refresh for some reason. :-/

-Si

Nenox
09-01-2005, 11:23 AM
Thanks a million!

Btw. Apart from the binMembership -add command, how did you find this info? Would like to learn to look in the right places and help myself. :-)

Sune

zylphyr
09-01-2005, 11:59 AM
since pretty much everything that goes on in the maya gui is mel based, you can go into the script folder where maya is installed and start poking around. With a modestly advanced text editor (like ultraedit) it's pretty easy to search for procs and follow the scripts to see what's going on. this also enables you to modify the beahavior and functinality of the maya GUI.

for this particular case is noticed in the script editor (with the "echo all commands" flag turned on) that the proc "hyperShadeCreateEmptyNewBin" was used when making a new bin, and doing a search on that in the scripts folder (ie: search in files), I could see what was going on.

-z

Nenox
09-01-2005, 12:50 PM
That makes absolute sense. Would be nice to have this stuff documented though.

Thanks a lot!

CGTalk Moderation
09-01-2005, 12:50 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.