Tutorial: Authoring Custom Effects
Many users may not be aware that it is possible to use SWiSH Max4 to author custom effects such as the one shown below. A custom effect can be based on any of the ten core effects. Custom effects use a Custom interface to offer a specialized user interface that is easier to use than the underlying core effect interface tabs.
The Custom interface for the “Rainbow bulge” effect is shown below. This exposes five parameters instead of the 30+ parameters associated with the underlying Transform effect.
The sample effect, “Rainbow bulge”, has five custom parameters. In this example, the parameters associated with the core effect (Transform) have been hidden from the end user.
The remainder of this article demonstrates how the above effect was authored. Once understood, the technique can be applied to allow authoring of a virtually unlimited number of custom effects.
By default, effect authoring is not enabled. To enable effect authoring use the Preferences panel (menu item Tools | Preferences | Effects) and set the checkbox Allow effect authoring. Note that effect authoring is not possible with the SWiSH miniMax range of products.
While the panel is open use the Specify additional folder option to specify the folder where you intend to save the authored effects. This option allows the specified folder to be searched for effect files (.sfx). Effect files and any sub folders containing effect files will be listed in the various effect menus when this option is enabled.
The additional folder option is provided as it is not possible to save authored effects directly to the main effects folder in Vista and Windows 7.
The main effects folder is normally located in C:\Program Files\SWiSH Max4\effects or C:\Program Files (x86)\SWiSH Max4\effects on 64 bit systems. Administrator permission is required to save files to those folders.
To author an effect, follow the normal process of applying an effect to an object. Select an effect that you want to modify (re-author) or choose one of the core effects. A custom effect can be based on any of the ten core effects. Many of the core effects will cause multiple tabs to be displayed in the Effects panel. The tabs associated with each of the core effects is shown in italics.
- Transform: Transforms, Cascade
- Squeeze: Squeeze, Transforms, Cascade
- Alternate: Alternate, Transforms, Cascade
- Snake: Snake, Transforms, Cascade
- Explode: Explode, Camera, Cascade
- 3D Spin: 3D Spin, Camera, Cascade
- 3D Wave: 3D Wave, Camera, Cascade
- Vortex: Vortex, Camera, Cascade
- Wave: Wave
- Typewriter: Typewriter
Motion and Easing tabs are available for all effects. These tabs can be hidden or displayed by using the << or >> button.
To author a new effect, rename the effect (New Effect in the sample image) and check the Author checkbox. This will cause the additional tabs to be displayed including the Author and Custom tabs. If desired, the default number of frames can also be altered to better suit the final effect that is authored.
The Author tab allows up to nine user configurable parameters to be defined. Once defined these parameters appear within the Custom tab. The columns used by each parameter are described below:
Prompt: Defines the description that is presented to the end user in the Custom tab.
Variable: The end user enters values for each prompt shown in the Custom tab. The value entered is saved to the associated variable. The variable is then used to calculate values that are used in other effect tabs.
Type: One of Edit, Check, Slider or Color. This defines the type of interface that is presented to the user in the Custom tab. Edit is a standard edit box, Check is a checkbox that returns a value of 0 for false or 1 for true. Slider allows the user to select a value using the slider or associated edit box. Color allows the user to select a color using a color swatch.
Min/Max: These columns allow maximum and minimum values to be defined if the Slider type is chosen.
The Only show the “Custom” page checkbox will cause the underlying core effect and associated tabs to be hidden when the Author checkbox is unchecked. Using this option will minimize the parameters that are presented to the user. When this option is selected, the Custom tab will appear as a single page or as a tab if the Motion and Easing tabs have been enabled with the >> button.
Once the Author tab has been filled out, select the Custom tab and enter reasonable values for the parameters that are presented. When the effect is saved, these values become the default effect values.
Formulas based on the defined variables can then be entered into any field assoicated with the underlying core effect. All fields in the core effect tabs can be configured to have a calculated value. A calculated value is a value derived from a formula consiting of numerical constants, variables and standard mathematical symbols + – / * etc.
Note: the Motion and Easing tabs cannot have formulas entered as these are not “core effect” tabs.
Note: forumlas can only be entered if the Author checkbox is checked and the user right clicks on the edit box for the item. Once the forumla has been enterd, the item will display the current calculated value. The calcuated value is shown in gray indicating that direct user entry is not possible. If the forumula contains an error (invalid symbol, undefined variable etc) it will evaluate as 0.
For example: 100+mz/2 is a valid formula. If mz is set to 50 in the Custom panel, then the formula would result in a calculated value of 125 (100+50/2). To enter the formula, right click on the desired edit box then enter 100+mz/2.
Using the Rainbow bulge effect as an example, the Author, Custom, Transforms and Cascade tabs are shown below:
As the Rainbow bulge effect is based on the Transform core effect, the Transforms and Cascade tabs are shown. Custom effects based on a different core effect will show a different tabs depending on the chosen effect.
As can be seen from the images above, the Custom tab displays the parameters that are defined within the Author tab. The Custom tab becomes the primary user interface for the effect. Values entered by a user in the Custom tab are written to the variables defined with the Author tab. For example, if the user enters a value for “Zoom” in the custom tab, the value is saved in the variable “mz”.
The Transforms tab has some items grayed out. The grayed items have had formulas entered in place of normal numeric values. The formulas entered for each of the items is shown below in italics:
- Middle Spacing: ms
- Middle Scale: mz
- Start Color: c1
- Middle Color: c2
- End Color: c3
The Cascade tab has had the At start and At end values changed from the default values to Repeating. If desired, calculated values could be entered for any item in the Cascade tab. However, in this example, no calculated values were used in this tab.
Once the effect has been authored and tested, it can be saved for re-use.
Saving the Authored Effect
As stated previously, Authored effects cannot be saved directly to the main effect folder. However, a second effects location can be defined in the Preferences panel. Once defined, the this location is searched and listed in the effects browser panel and other effect menus.
Personally, I divide my authored effects into category sub folders similar to those used by Max. My categories are: Appear, Disappear, Looping, One off and Return to start.
The category sub folders are located in a folder named Authored which is a sub folder of the folder specified in the Preferences panel.
This allows all of my effects to be grouped in the one location and still be sorted according to category. (See the effects panel image). Note that sub folders or only listed if they containing .sfx files.
For example, if the folder defined in the preferences panel is:
I create my category sub folders in
For example, “Rainbow bulge.sfx”
For a preview of the effect to appear when the effects browser panel is used, create a movie that demonstrates the effect and save the correponding .swf file using File | Export | SWF…
Save the .swf file with the exact same name as the effect. Save the .swf file in the same folder as the .sfx file.
For example, “Rainbow bulge.swf”
After saving the files, select the effects browser panel and press the F5 button to refresh the tree structure.
The sample effect Rainbow bulge can be downloaded from here. If you wish to use this effect with the effects that are currently supplied with Max4 (or miniMax4) , copy the .sfx and .swf files in the zip file to: C:\Program Files\SWiSH Max4\effects\Looping continuously or C:\Program Files (x86)\SWiSH Max4\effects\Looping continuously on 64 bit systems. You will need administrator permission to copy this file.