Jump to content

Want Script in max toolbar problem


danb4026
 Share

Recommended Posts

I have a simple script (ms file not mcr) that I want to place on my toolbar. Although the script is in my Scripts folder, it doesn't show up anywhere in my "customize user interface" Groups or Categories, so I cannot place it anywhere for easy access.

 

Right now I have to run the script from the maxscript drop down list every time. Is there a way to place this script in the toolbar? I even tried to simply drag and drop on the toolbar, but that doesn't work either. Thanks..

Link to comment
Share on other sites

I go through this every time I reload my o.s. or upgrade my system. Let's see..customize/customize user interface/toolbars tab/ then find your script on the list to the left. Now if it's not even showing up on the list you obviously can't create the first button. Try this, First to goto scrips/run script and run it (even if nothing happens) then try the steps above. I had to do this before I could make the button once but not sure if it will work for you.

Link to comment
Share on other sites

your .ms file name may be different than the script name on the Custom User Interface list. For ex: the script called "VRayMtlConverter2.ms" shows up as "Convert all scene materials to VrayMtl and......." some long string. so if I'm looking for V on the list i won't find it.

Link to comment
Share on other sites

Two ways you can do it:

 

1 - post the script in here and i'll make it macroscript for you or

2 - go to the maxscript menu and choose open script, find your script and hit open. Once opened select all the code (ctrl + a) and drag it to the toolbar you want your script to be. I would change the generic icon that max assigns to it to text. To do that right click the button and choose "Edit button appearance", select the "Text button" and name it as you want, just make sure you keep it short.

 

Let me know if you have any issues.

Link to comment
Share on other sites

  • 3 months later...

This might be a bit belated - but something i think is worth sharing.

 

Max has macroscripts and maxscripts

 

macroscripts show up in Customize UI/...

 

maxscripts run are typically run straight from the editor window (CTRL+E)

 

A maxscript can be turned into a macroscript easily in two ways:

 

1. Declare it at the beginning of your maxscript with this:

 

macroScript Layer Script --THIS IS SCRIPT NAME

category:"My Scripts" --This is the Category name in Customize UI

buttonText:"Layer Script" --Text in Button

toolTip:"Layer Script" --Text of the Mouseover of Button

 

-after you add this - you'll need to save your .ms as a .mcr and install it by running the .mcr from the editor, or drag it into max window.

 

NOTE: CTRL+E for this will only install it when it has this heading. I wont run it anymore. If you delete the four lines, the maxscript will run like normal from the editor.

 

2. Create a seperate .mcr that references the maxscript file: (This is what i do most)

 

make a .mcr file (i name it the same as the .ms file)

 

put this in it:

 

macroScript Layer Script --THIS IS SCRIPT NAME

category: "My Scripts" --This is the Category name in Customize UI

toolTip:"Layer Script" --This is the Text of the Mouseover on Button

 

(

on Execute do

 

(

fileIn "$scripts\Layer Script.ms"

)

)

 

-the above is if the script exists in your 3ds max/Scripts folder. if its somewhere else, hardcode it and it will work.

 

Hope this helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...