Tutorial Three
The animated translucency script.

One might wonder why I bothered since this will be coming out in the upcoming renderers in a much more usable form, but it was something of a challenge.

1. Open the file linked here. Looks something like:

Just a simple box with a bend modifier (not doing much, just to demonstrate it works on deforming meshes), a shadow casting object, and a moving lightsource.

2. The box needs to be an editable mesh, so add a 'Turn to mesh' modifier immediately above it in the stack, then RC on the 'Turn to mesh' modifier and pick 'Collapse to'. This gives us an editable mesh with a bend modifier.

3. Run the animated translucency script - brings up a dialog looking like:

if you don't have john burnetts jblib and jbfunctions installed, you may get a warning. Then again, you may not so make sure you have the latest ones installed, www.johnburnett.com.

4. In the Main Params hit the 'Pick Objects' button, then click on the bending box. (If your object is not an editable mesh you will get a warning at this point). In a shaded view the box will change appearance - it may go all white, all black, or end up with some coloured spots. This is normal.

5. Use the 'Pick Lights' and 'Pick Objects' for the shadow objects to pick the light and the narrow box respectively. Note that if you want self shadowing you need to pick that as well. Toggle the 'Shadows On' checkbox on.

6. Set a file output seed - this is where the data files will be stored. Since max does not allow animated vertex colors this was my solution. Click the 'File output seed' button in the main params and set a filename in a separate folder, quite a number of files are created and you don't want them lying around.

7. We only have one object selected so the main search radius is enough, but for the sake of it now hit the 'Add Cust. Att.' button in the 'Translucency Settings' groupbox. This adds some custom attributes to each object in the Selection Array. Select the box, go to the baseObject (the editable mesh entry in the stack) and scroll to the bottom where there is a new rollout 'Search Radius Controls'. Set the Search Radius here to 60.0. If this custom attribute did not exist the script would default to using the search radius in the main dialog.

8. We are ready to go, so make sure the start and end frames in the Main Params are 0 and 20 respectively, then hit the 'in Scene' button in the 'Save Settings' group, then OK the messagebox to save your settings. If we need to revisit the translucency later, all the settings will be saved with the file.

9. Now hit the 'Generate Vertex Data' button, bottom left. You could have increase the MXS heap which can speed things up with heavier scenes, but the default should be fine for now. The interface will flash several times during generation, I may improve this (it's harmless enough). This will take about half a minute on a dual 450. Note that all this is single threaded, so two max's doing half each will be faster, and you can always spread it to other machines by hand.

10. Once this is finished, press the 'Add/Upd. scirpt to auto load VC's' button. This adds a script controller to load the data. I should probably do this automatically since the script is useless without it. Then hit the 'Toggle interactive loading' button. This turns on the script in the viewport which can slow things down so this toggle, in renders it is automatically turned on via some callbacks. Drag the timeslider to see the result.

That's about it. I've already assigned an appropriate material to the box so you can render if you like. It is important to use the falloff material set to shadow/light to get useful results.

The solution is controlled by a multiplier value for each object (in this case just the one) you can change that by selecting just that item in the 'Selection Array' listbox, and changing the 'Modfiy Soln. Multiplier' value underneath.

Click this image for the resulting animation based on the sample file supplied. Not terribly impressive, but only a 20 frame sequence: