Go Back   EnjoyCG > Tutorials > EnjoyCG tutorials
register now

Welcome to EnjoyCG

EnjoyCG is a community and resource for 3d artists, students and designers. Browse our tutorials, read the latest news or ask a question on the forums.

New around here? register
  #1 (permalink)  
Old 16th December 2008
MrTom's Avatar
EnjoyCG staff
Join Date: Mar 2007
Location: England
Posts: 1,356
Thanks: 3
Thanked 50 Times in 42 Posts
Adding your own Menu

Time is always against us, so anything to speed things up has got to be good right?

Well, hopefully.

This is a quick tutorial to show you how to add your very own Menu in the Max Menu Bar....right next to the 'Help' menu to keep it company....you can put it anywhere but this seems a good place.

Why would you want your own Menu? Well, in it you can put a whole bunch of things that you find yourself using over and over again. It's a way of collecting commonly used tools or processes that are specific to your workflow......so essentially should save you some time.

As an added 'XMAS' bonus I'm going to throw in a little script I've written to help those of us that use VRay as our renderer. In fact, although it was written with VRay in mind anyone can use it and may find it useful.

One thing that really annoyed me about using VRay was always having to change my materials to VRaymtl's before creating anything. Resetting the Material Editor ALWAYS reset the slots to 'Standard' materials....not something I use too often with VRay. As there was no means of changing the 'Default' materials from within the Editor itself I set upon writing a small script to do just that.......now with just a couple of clicks I can have ALL 24 slots filled with a Default VRay Material......very handy I thought.

Anyway, the tutorial is basically about the Menu, but also involves scripts so it's a bit of a mixture of stuff but hopefully you will see the scope for using your own Menu, and the huge advantage you can gain from using scripts.

So......lets get on with it.

The tutorial is written using My script as an example, you don't have to use it but you will have to adapt the tutorial if you don't.

It works with Ver.2009 but is untested with other versions...sorry if it doesn't work with earlier versions but if it does then please let us know here.

You can download my script here: Set Material Slots.


1. First extract the script to the macroscript folder.

Path= "<Max Root>\ui\macroscripts"


2. Start Max.


You will notice at the top of the workspace the usual Menu Items ending in the 'Help' Menu. We will add our own personal Menu to the end......





Actually I'm going to add an ECG menu but you get the plot.

3. Click on Customise>Customise User Interface...

This brings up the User Interface where we can add our own Menu.

4. Click the 'Menu' tab....

Here you can see on the right all the current menu items. By clicking on the small '+' signs you can expand the menu to see the items contained within it.....they should all be familiar to you.

5. To add our own 'Menu' click on the 'New...' button......





6. Enter a name for your new Menu....





Once you click on 'OK' you won't see much difference but your new Menu is now located in the 'Menus' list at the lower LEFT of the User Interface....





7. Your new Menu needs to be placed into the list on the right.....under the 'Help' menu item...so....click on your menu and DRAG it to the RIGHT hand pane under the 'Help' menu item....(The Blue Line will show you where it will go when you drop)





Once done you should now have your new Menu in the Menu Bar at the top of the workspace....



How cool is that?

You can click on your new menu but nothing will happen just yet.....you don't have anything in it!

You could also expand the new menu in the list by clicking the '+' sign...this will also show you have nothing in it....yet!





So to add something to your new menu...here you could choose what you like but for the purpose of this tutorial I'm going to use My script as an example.

When the script was written a 'Category' was encoded within it....this is why the script has an .mcr extension and not an .ms extension...now you know!

8. The 'Category' I encoded into it is, suprise, suprise, 'MrTom'. Under the 'Category' drop down list, find 'MrTom' and select it.





As this is the only script I've written there should only be one item to choose from in this 'Category'. If, and that's a big IF, I write any more, I can put them under the same category and then they will show up here also....pretty neat huh?







9. As there is only one to choose from...select 'Set Material Slots' and again DRAG it to YOUR menu item on the RIGHT......





You can leave this as is or put a 'Separator' after it by again just dragging the 'Separator' (the dotted line on the left under Separator) and dropping it into your menu.

10. Once done you can now 'Save' the new Menu layout. If you click 'Save' the default 'Start' file will be displayed and offered as the filename to save as. If you overwrite this file then your menu will be included everytime you start Max....if you save as a different filename you will have to load it after Max has started.

Now you have saved your new Menu Layout you can click on your new 'Menu' and see that 'Set Mtl Slots' is now an option....





If you now click this option it will run my script and you should see the window as below...





It should be fairly obvious as to what it does. If you have the Material Editor open and select 'Fill ALL Slots With...VRay Materials', you will see ALL material slots change to VRay Materials when 'SET' is pressed.

You can use this to set back to 'Standard' Materials too....which may be where it is useful for MR users....to clear the Editor Slots. note that any Materials in the scene will NOT be affected, only the Editor Slots are cleared.

So that's about it. You can add virtually anything to your new menu....finding it is the hard part...but it can be useful for third party plugins that require their script to be run from either the 'menu bar' or the 'quad menu's'.....now you can keep them all in your very own Menu.

Addendum:
If you don't want to add your own menu but still want to run a script you can open the script, (.ms or .mcr), in the Maxscript Editor, select ALL the code, and drag and drop the code onto an empty space in the TOOLBAR. This will create a new 'Button' from which you can then 'run' the script.

Regards.

Attached Images
 

Last edited by MrTom; 11th February 2009 at 01:30 AM. Reason: Added info
Reply With Quote
Reply

Bookmarks

Tags
adding, in practice, menu

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads for: Adding your own Menu
Thread Thread Starter Forum Replies Last Post
dynamics Adding Mass to an Object BiOjOe EnjoyCG tutorials 5 31st August 2007 09:20 PM
Adding Vertices to a plane? Wiggy 3d studio max 4 29th May 2007 06:55 PM
help menu not working and no clue why chickentech 3d studio max 3 11th March 2007 08:25 PM

All times are GMT +2. The time now is 05:23 AM.
Copyright © 2006-2009, EnjoyCG