Going Further with MAXScript Well, here we are, a ten-word vocabulary and two tools later. Hopefully this chapter has opened your eyes to the possibilities of MAXScript and made it seem more accessible. To sum up the main points:- A few words of MAXScript go a long way.
You learned that with a small vocabulary and a little help from the show command and for loops, you can batch-process almost anything in your scene with a line or two of code in the Listener. Judicious use of the random command can help you create more believable scenes and animation with minimal effort. - Everyone needs help.
Using the Reference file is mandatory, even for full-time technical directors. Refer to it constantly, and get comfortable with the various search functions. There are a lot of friendly and helpful scripters online, too, so don't be afraid to post questions (using your real name) in Discreet's MAXScript forum. - Create interfaces quickly with Visual MAXScript.
You learned that the Visual MAXScript utility can be used to sketch out the interface for a custom tool, separate from the code that actually does the work. Building a complete tool is then just a matter of adding proof-of-concept code to the event handlers of each UI element to make it do what you want, and debugging any problems that pop up along the way. - Dockable dialogs let you use MAXScript widgets in custom toolbars.
You learned that dialog bars, first introduced in 3ds max 5, are an efficient way to turn your UI code into a tool floater. Additionally, dialogs can be made dockable, so that they function as toolbars in your interface.
Taken together, these skills represent a formidable arsenal of time-saving tools. The key to developing your skills is to look for situations where a script could be useful and to force yourself to use scripted solutions, even if it's slower going at first.Some signs that a problem may be amenable to scripting include the following:- Boredom.
Repetitive tasks, like adjusting the same setting on dozens of objects or performing the same series of actions on dozens of files, can often be scripted with a for loop. - Aching wrists.
3ds max is a huge program, and its user interface is designed to be all things to all artists out of the box. If you find yourself clicking deep into an obscure dialog all day long because your workflow requires it, consider building a custom dialog to make those functions more accessible.
Once you've identified the task you want to script, use the principles from this chapter to design, proof, test, and implement your solution. Now go forth, and shorten your workday! |