World Machine Tip of the Month : Tuesday, April 29th, 2003.#5: An Introduction to Macros |
World Machine v0.99 brings a host of new features to the table, but by far the most powerful (and most confusing!) is macros. This is a four-part tutorial. The first part describes how to use macros. The second, how to create them; the third, how to work inside the macro world. A fourth part, describing how parameterization and scalar devices work, will be posted next week! |
The easiest way to envision what a macro is, is to imagine a "black box". This box has some holes to put input into, and some holes that output comes out from. What goes on inside that box may be extremely complicated, but as far as you're concerned, it doesn't matter, since all you ever see or interact with are those limited input and output holes.
That, in a nutshell, is a description of how macros work. They are a way for advanced World Machine users to encapsulate very powerful and complex device networks into a simple, easy to use package that anyone can enjoy. Although macro creation can sometimes grow complicated, macro usage is very, very easy -- so lets' cover that first!
World Machine has the concept of a Library for macros. This library (actually a folder under your World Machine installation directory) contains all of the macros that you or others have made on your machine. World Machine comes standard with several default macros, so let's try loading one of those to see how they work.
Go to Heightfield Operators on the menu bar, and choose "Macro from Library...". The dialog that pops up will show you the current list of macros residing in your library. On the right side, it lists the author of the macro, and a description written by that author on what the macro does. | ![]() |
Select the macro "Rocky Run" and hit OK, then click anywhere in the device workview. A new grey box will appear! It behaves identically to any other devices in World Machine. You can see that since it has no required inputs, only an optional one, it has already built itself and you can see what the macro looks like in the preview window at left.
![]() |
![]() |
Well, that's sort of neat, but the real power comes from the parameterization of a macro. This means the ability to make changes (sometimes very complicated ones) to the inside of the macro without ever crossing the threshhold into that world. "Rocky Run" has been parameterized with a variety of different options. Double-click on the macro to access them, just like you would any other device, and you'll see: | ![]() |
All of these sliders control different aspects of the generated terrain. What each slider does is up to the creator of the macro, so your best bet is to play with them and see what happens! |
Macros are a natural for sharing between users. To install a macro you've downloaded from someone else, simply copy or move the macro file into the /library folder underneath the directory you installed WM to.
Until then, manual installation by moving the files to the /library folder is the only method for installation. |
The previous is great, but the real burning question for intermediate and advanced users is: how do I create my own macros? The answer lies on the next page!