Using Scripts to Power Up 3DS Max

At TILTPIXEL, artists take turns hosting monthly lunch and learns. It is a process that promotes growth and leadership, and it’s anyone’s guess as to which topic an artist will present. Last month, 3D Artist, Cameron Bailey shared his tips for using scripts in 3ds Max. Read on to learn some of the tricks behind Cameron’s speed and artistry, as well as his Top 5 personal favorites for Max.


Why Scripts
Scripts increase efficiency – and when juggling deadlines, efficiency is king. Utilizing scripts can turn 3ds Max into your dream machine. They make the life of a 3D artist easier, and they make Max that much more powerful.

So, what are you waiting for? Read on to learn how to find and install scripts, and which scripts make Cameron’s Top Five list.


Finding and Installing Scripts
I find ScriptSpot to be a good source for 3ds Max scripts and plugins:

To install a script, first go to the Scripting drop-down on the toolbar.

Navigate to “Run Script.” Note that “Open Script” will open the actual script’s code so you can edit it for your needs, assuming the author hasn’t encrypted the source code.

Clicking “Run” will open 3ds Max’s default script’s folder in Window’s Explorer, although you can open a script from anywhere on your computer.

You can also click and drag the script file from Windows Explorer into 3ds Max’ viewport, and it will run the same way as mentioned above.

Types of Scripts: Macro vs. Non-Macro

Scripts have a variety of forms and functions. The example shown below is the “Kitchen Cabinet Creator,” which does just that: builds cabinets. The form of this script is a non-macro pop-up window.

Pop-up simply means that running the script will cause a new window to open. This window has options that allow the user to interact with 3ds Max in a way specific to the script. In this case, the pop-up has options for cabinetry parameters and the ability to put those parameters to geometry, which the script makes for you.

Pop-ups can be in the form of “non-macro” or “macro,” which refers to the way in which you call up the script. If a script has a macro, it can be assigned to the toolbar or a hotkey, or to the quad menus within Max. This means that you don’t have to load the script directly every time you want to use it. If using a non-macro script, it must be loaded with the Scripting>Run>Open Script method from above.

You can determine if a script is a macro just by looking at the saved file before you open it. A macro script will generally have the extension “*.mcr”. Non-macro scripts have the extension “*.ms”. You may also see the “*.mse” and “*.mzp” extensions, which mean maxscript encrypted file and maxscript zip package file respectively. An mse file is encrypted, so if you wanted to write a script and sell it, you could without fear that someone will edit or steal your proprietary code. An mzp is for collecting the related files that make up a scripted tool into a single file that you run instead of multiple. An mzp can contain script source, bitmaps, icons, and so on. Both can be run in the same way as regular ms and mcr script files. This is what the extensions should look like, minus the color:


Editing Scripts

Editing scripts that you have downloaded is simple. You can either edit in 3ds Max, which gives you the option to test it quickly to see if your script works. Alternatively, you can edit maxscript in any text reader, such as Window’s built-in Notepad. Note that if the script is encrypted, it will look like this upon opening:

A non-encrypted script will look like normal code, such as this:

( rollout lockUnlock "lockUnlock" width:84 height:63 ( label lbl1 "Links info :" pos:[2,2] width:80 height:15 button btn1 "Lock All !!?" pos:[2,19] width:80 height:20 button btn2 "Unlock" pos:[2,41] width:80 height:20 on btn1 pressed do setTransformLockFlags selection #all on btn2 pressed do setTransformLockFlags selection #none ) createDialog lockUnlock style:#(#style_titlebar, #style_toolwindow, #style_sysmenu) )

Finally, if a script has a coded macro, it will look like this:

macroScript lockUnlock category:"Vinc3rz tools" toolTip:"Lock/Unlock" ButtonText:"Lock/Unlock" ( rollout lockUnlock "lockUnlock" width:84 height:63 ( label lbl1 "Links info :" pos:[2,2] width:80 height:15 button btn1 "Lock All !!?" pos:[2,19] width:80 height:20 button btn2 "Unlock" pos:[2,41] width:80 height:20 on btn1 pressed do setTransformLockFlags selection #all on btn2 pressed do setTransformLockFlags selection #none ) createDialog lockUnlock style:#(#style_titlebar, #style_toolwindow, #style_sysmenu) )

Note the first four lines of code, as they are what make the code a macro script. You could add or remove them from a code and it will still work–all the first four lines are doing is telling max where to store the code with in the custom user interface from before.

Opening Scripts with Macros
The first time you use a script that has a macro, you must open it the same way as a non-macro. Once opened for the first time, however, you can map it to a hotkey, quad menu, or toolbar for faster opening in the future. Simply go to Customize>Custom User Interface. This will bring up a window that will allow you to assign the script that you just ran to a desired operation (hotkey, quad or toolbar).


Cameron’s Top Five Favorite Scripts
Picking just five is tough, but if I must choose, these are the ones I rely on the most:

Isolation Levels
This script allows you to make levels of isolations and quickly move back and forth between the levels as needed. Max’s native isolation method only allows you to go forward, so if you reach a point where you need to add geometry back into an isolation, you must unisolate the entire scene, make the same selection that you first had and then isolate again. This may not be an issue for small scenes, but it becomes increasingly cumbersome since the viewport’s frame rate may dip as the scene grows. Iso Levels, however, allows you to simply hit the back arrow that comes with the script, and the desired geometry pops back into the scene – bypassing the need to unisolate the scene.

With just a few clicks, this script allows me to move pieces of geometry from one scene to another, making the task incredibly easy.

Select Instances Objects
When you have tens if not hundreds of the same object instanced in a scene and you need to select all of them, this script simplifies the process. I can select all objects with a single click, rather than finagling camera angles to get everything in a dragged selection fence or by clicking them on to select them.

Copy Replace
We’ve all been there: you put 50 lights in a ceiling. They’re all the same, just spaced throughout the scene. You place the last light when you realize you forgot to instance them to each other. You can either delete them all and replace them with “instance” checked, which takes time, or you can simply select them all and run this script. Ten seconds and it’s done.

Relink Bitmaps
This is incredibly helpful when your files have been moved from their original place. In just two or three clicks, this script will relink your missing maps.


About Cameron
A master of useless knowledge and a skilled 3D artist, Cameron Bailey joined TILTPIXEL two and a half years ago. He’s been honing his rendering skills and delighting clients ever since. When not cranking out high-end digital imagery or learning photography and coding, Cameron can be found debating the intricacies of movies, music and more. We asked him to give us his latest preferences, in no order…

Music:  Weeknd, Sam Smith, Dermot Kennedy, Manila Grey, Post Malone

Movies:  Fight Club, Pirates of the Caribbean – Curse of the Black Pearl, Storks, WALL-E, Ocean’s Eleven films

Television:  Futurama, Frasier, South Park

Games:  Currently playing Call of Duty WW2 and Tekken 7 – and looking forward to the new God of War

Books:  Frankenstein