Randomization#

In this section, you will learn how to automatically create and export variations of your projects! This feature is also known as “wedging”. This is useful, for example, if you have a project that needs lots of similar elements, if you want to have some options to show your supervisor, or if you wish to get that perfect random seed for your hero element.

Setting up randomization#

You can randomize a parameter by setting the override to Randomize Override. This is done by Shift + left mouse button clicking the no override circle next to it. A randomized parameter is indicated with the randomize icon icon. To disable the Randomize Override, left mouse button click the randomize icon icon to set it back to no override No Override.

Once you’ve selected your parameters for randomization, you can manage them in the Randomized tab.
You may notice there are parameters there you didn’t select for randomization. This is because, by default, all Seed parameters are set up for randomization.

You can remove a parameter from the randomized tab by left mouse button clicking the randomize icon icon next to it.

The Randomized tab contains mostly range sliders with the regular parameter slider right next to it.

With the range slider, you can specify the minimum and maximum value between which the random value can be picked.

With the regular parameter slider right next to it, you can see and edit the current parameter value. This value will be overwritten by a random one from within the specified range when the parameter is randomized.

A parameter is randomized by clicking the update icon icon next to it.

To randomize all parameters you can click the blue Randomize All button or the randomize seeds icon icon in the top right corner of the UI.

Example:

randomized radius

With this setup, you can set the Radius with the right slider but when the parameter is randomized its value will be overwritten by a random value between 1 and 3 as specified by the range slider.

override states

Different parameter types are set up a bit differently in the Randomized tab. Let’s look at them in order of the image on the right:

  • 3-vector parameters are split up into three range sliders each representing an axis. This means that you can define the amount of randomization for each axis. For example, if you want to randomize the Z axis only you can set the other two to a fixed value by inputting the same value in the min and max fields on the range slider.

  • Value parameters, which are the most common ones, are represented by one range slider.

  • Checkboxes in the randomized tab have a random chance of being turned on or off when randomized.

  • Dropdown menus are assigned a random menu item upon randomization.

  • Range sliders are split up into two range sliders, one for the minimum value and one for the maximum value. For example, you can give particles a different maximum age between 1 and 5 seconds for every variation by setting the Lifetime limits Max component to have a minimum of 1 and a maximum of 5.

Randomized explosion example:

explosion node setup
Here, we have an explosion with a simple emission setup using a sphere and a volume emitter.
Let’s say we need eight similar explosions.
The general shape of explosions (or most effects) is determined by how they are sourced.
In this case, the shape of the explosion is mainly due to the random pressure injected by the emitter.
Since we want similar explosions, we can use the Pressure random seed parameter.
Using seed parameters is a good way of getting variations without changing the intensity or the scale distributions of your effect. Find out what random forces have the most influence on your simulation and randomize the corresponding seed value.

Let’s now say we want to expand our options here and see eight different explosions.

Have a look at how the Randomized tab is set up now and why.

randomization tab

The parameters that determine the attributes we want to vary for this explosion are the ones added to the Randomized tab.

  • Fuel rate has a major effect on the overall size and intensity of the explosion. The range is set from 300% up to 700%, the way these values are determined is by experimentation. Values below 300% made the explosions too weak to look realistic and values above 700% made the explosions too big for the bounding box. This means that all values in between will give variations with good results.

  • Additional pressure rate will determine how random the shapes are. Higher rates will give more random organic shapes because more random pressure is injected. Lower values will give more spherical atomic bomb-type shapes. The range is set up from 0% to 700% because 0% gives the option of a very spherical explosion and everything above 700% didn’t give good-looking or unique results.

  • Note that Fuel rate and Additional pressure rate both affect the intensity of the explosion. Therefore make sure you check the scenarios where those parameters are both at their minimum and at their maximum values in their ranges so you can see if these potential variations are still desirable.

  • Pressure random scale determines the scale of the random pattern in which the pressure is added. The range is set from 0.1 to 0.4 based on the range of the biggest and the smallest desired details. Here, higher values give smaller details. So higher than 0.4 the difference would not be interesting as it gets too small. It’s important to find the right min and max points for your range to get the most diverse variations.

  • Pressure random seed is left at the default range since for seed parameters any different value will give a completely different pattern.

  • Position has the range set to 0 in min and max for the X and Y axes. This ensures that these values will be 0 in every variation not moving the sphere in those axes. The Z axis has a range from 10 to 30 meaning that in every variation the sphere is at a different height in between those values. This can give some interesting variation in the shockwave and intensity.

Exporting variations#

Exporting variations starts by setting your render icon Render, export icon Export:Particles, or export VDB icon Export:VDB node up like you normally would. But with the addition of using the $(variation) variable in the Directory or the Filename field. If you don’t use this, the files will be overwritten for every variation since there is nothing unique in the directory or filename.

Example:

render directory settings
  • Here, with myExplosion being the project file name, a folder called myExplosion_variations is created in the project directory (where the .ember file is stored).

  • Within that directory, numbered folders will be created for every variation.

  • In those folders will be subfolders for each render pass.

  • All files will be dynamically named based on the filename, variation number, and render pass. You can see a file name example next to the Filename field.

To export variations instead of exporting once go to File/Export Variations… in the top left corner of the user interface.

The Export Variation window will pop up.

export variations window
  • Number of variations: The number of times the simulation will run and export.

  • Randomize first variation: If checked, all parameters set up for randomization will be given a random value before the first variation is exported. If unchecked, the first variation will use the values you currently have.

  • Save project copies: If checked, project files for each variation will be stored in a specified location with a specified name. This way, you can reproduce every exported variation since otherwise, you won’t know what random values were assigned.

  • Nodes to export: Here, you have a list of nodes where you can check the ones you want to use for exporting your variations.

  • Cancel: Close the Export Variations window and don’t export.

  • Export Variations: Start exporting your variations!

Example:

We’re still using our myExplosion project. When using the settings in the image above:

  • 8 variations of my explosion will be exported.

  • The first variation will be the exact simulation we currently have (maybe because we like that one)

  • A project copy will be saved for each variation storing their settings for later use. The project files will be stored in the project directory in a subfolder called myExplosion_variations and named myExplosion_v1, myExplosion_v2, myExplosion_v3, etc.

  • We just want to export from the one render icon Render node so we’re leaving that one checked and the rest unchecked.

  • After hitting the blue Export Variations button and seeing the magic happen we have my eight unique explosions!