Adding Variations for a More Realistic Environment
Randomizer is a UnigineEditor tool designed for adding variations of the scene objects in few clicks.
The Randomizer can perform the following operations with nodes:
- Replace the selected nodes with other nodes taken randomly from the specified set according to the normal law of distribution.
- Change position, rotation, and scale of the selected nodes randomly within the range according to the normal law of distribution.
Randomizer Settings#
The Randomizer tool provides the following settings:
Offset | Offset of the selected nodes taken randomly from the specified range. An offset range is specified for each axis.
|
---|---|
Rotation | Rotation of the selected nodes by the angle taken randomly from the specified range. Rotation is performed relative to the current direction of an axis. An angle range is specified for each axis.
|
Scale | Scale of the selected nodes taken randomly from the specified range. A scale coefficient is specified for each axis.
If you enable the Uniform Scale option, you can specify the coefficient only once: the nodes will be scaled along all axes.
|
Place Nodes as NodeReference | Toggles adding the specified nodes as NodeReferences to the scene on and off. If the option is disabled, the replaced nodes will change its types to the types of the replacing nodes stored in the .node files. |
Nodes | Set of nodes (.node) or/and meshes (.mesh) that will be used for random replacing of the selected nodes. To add a new node/mesh, click or drag a file from the Asset Browser. The following fields will appear:
|
Replacing Nodes#
To replace nodes with other nodes taken randomly from the specified set, you need to do the following:
- Select the nodes that should be replaced.
- Add nodes that will be used for random replacing of the selected nodes in one of the following ways:
- In the Nodes section, press , then click in the field that appears and choose a .node or .mesh file in the dialog window that opens.
You can specify a .node file stored inside the asset container.
- Select the required nodes in the Asset Browser and drag them to the Nodes section.
You can also drag an .fbx, .dae, .obj or .3ds file: a .node file stored inside the asset container will be specified automatically.
- In the Nodes section, press , then click in the field that appears and choose a .node or .mesh file in the dialog window that opens.
- Specify the probability of the node occurrence in the field to the right.
- Toggle the Place Nodes as NodeReference option on, if required.
- Click Replace.
The randomization will be performed according to the normal law of distribution.
Usage Example#
For example, we have several identical barrels:
To diversify the types of barrels, we need to perform as follows:
- Select all barrels in the scene.
- Add the .node files with different types of barrels to the Nodes section by dragging them from the Asset Browser.
- Specify the probabilities of occurrence of each type of barrels:
- 10 for red barrels
- 5 for blue barrels
- 2 for light brown barrels
- 1 for brown barrels
According to our set probabilities, the frequency of occurrence of barrels of each type will be the following:
- 10/18 for red barrels
- 5/18 for blue barrels
- 2/18 for light brown barrels
- 1/18 for brown barrels
- Toggle the Place Nodes as NodeReferences option on, so that the specified nodes are added to the scene as NodeReferences. It may be useful if you will decide to change barrels of a certain type later. In this case, you will need to edit only one barrel: the others will be updated as well.
- Click Replace. The selected nodes will be replaced with the node references from the list.
Transforming Nodes#
To translate, rotate or scale the selected nodes randomly within the specified range, you need to do the following:
- Select the nodes that should be transformed.
- Specify ranges for the Offset, Rotation and Scale values.
- Click Replace.
The randomization will be performed according to the normal law of distribution.
Usage Example#
- Select all barrels in the scene.
- Specify ranges for the transformation parameters:
- [30;180] degree for rotation about the Z axis.
- [0;30] for offset along the X and Y axes.
- [1;3] for scale by the X, Y, and Z axes.
- Click Replace. The selected nodes will be transformed according to the specified values.