Softimage|XSI Dominos Script

or how to place and animate dominos on a path

Dominos.v0.1.vbs - 5kb

Dominos_Test.scn - 207kb

Scenario
Some tasks wich involve numerous similar objects can quickly become a real nightmare, if done by hand.
 
Here we want to place and animate numerous dominos - 1000, 10000 even more - along a path, without dealing with each domino individualy.
 
With the help of scripting, this can be done easily, giving us the ability to interact with the spacing and the timing of each instance.
 
We can even choose an existing curve along wich the dominos will be placed.
 
Last, you deal with only one source object regarding the animation. The other instances will refere to it.

Note:  Curently, only rotx of the source domino is taken into account with the other instances.

Script Installation

First, open the 'Browser' and select the folder where the script is.

Switch from the 'Toolbar Panel' to the 'Palette' and the 'Custom Script Panel'.

'Drag & Drop' the script file directly to the 'Custom Script Panel'. The 'Add Script Command' will open.

Enter the name you want to see on the button in 'Command/Button Name' and the name wich will be use for script command in 'Command Name For Scripting'.

The Script and his button are now installed and ready to use.

Tutorial

Create the domino facing the front view then animate it in rotx.
Don't forget the thickness of the following instance once lying down.

Create a curve wich will be the path where the dominos instances will be placed.
Draw it in the XZ plane.

Select the source domino ( your animated object ), then click on the 'Dominos' button we just add.

SelectedObj: ( readonly ) Reminds you the name of the selected object.
Copies: The number of instances that will be created.

Once you made your choice, click the 'OK' button.

Pick the curve with the left mouse.

After a certain time, depending of the nombre of copies you've asked, the dominos instances are created along the path, with an arbitrary spacing.

What's happened ? Observing the 'Explorer' will give us an idea of the structure created.
 
A NULL named "<name_of_the_source_object>_DominosInst" has been created wich will hold all the other elements created by the script.
 
Dominos instances have been created as well, each of them parented to a NULL, parented itself to the main NULL.
 
The NULL instances have been constrained by 'Path' to the curve, while the dominos instances received an expression linking their rotx with the source object.
 
Why do we have created a NULL for each instance ?
Because when there is a 'Path' constraint with 'tangency' option activated, you can't control their rotation anymore. Here, the instances are just parented to the NULL wich are constrained, so they are free to receive any animation/expression.

Once the setup created, the custom parameters panel appears, wich will help you to adjust the global animation for all the dominos instances.

Spacing: spacing between each domino instances ( in Path % )
Timing: timing offset between each instances ( in sec )

Now you just have to adjust these settings to obtain the final animation.

Tips and Tricks

If you have to create 10000 dominos, its obvious that the 'interactive' controls will suffer.
 
You just have to adjust your settings with 10 or so dominos, copy the 'Spacing' and 'Timing' values. Then delete the tree, recreate the setup with 10000 dominos, then paste the values to the new custom controls panel.
 
For the animation of the source domino, you will certainly observe that each instance will pass through the following ones during the rotation.
 
To avoid this, you have to break the continuity of the animation at some point, to reflect the domino impact as showed in the following picture. I've exagerated it.

Any feedback, critics and suggestions are welcome.


[rev. 07/12/01 - d/m/y]

Copyright ©2001, Guy Rabiller