This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Instancing Nodes

The virtual world, that you're building, may contain a lot of identical objects, that should always look the same, such as electricity pylons, planes, wheels, boxes, etc.

When you clone these objects and place them in your world, multiple separate copies are created. Thus, if you decide to change something (e.g., the geometry or materials of some parts of the pylons) you'll have do that for each copy individually.

Instead of making copies of an object, it is recommended to make instances of a single one. Such approach ensures integrity when changing the parameters of the repeatedly used objects, especially if they are complex and sophisticated. To do so, You can simply add several Node References referring to a single *.node file and then edit only one node reference in order to update all of them.

Below is the typical workflow for node instancing based on Node References.

1. Creating a Hierarchy of Nodes#

First of all we should prepare the basic hierarchy, that will represent our object. Suppose we have organized the nodes hierarchy for a helicopter, that we are going to reuse several times in our world (see the picture below)

2. Converting the Hierarchy of Nodes#

The second step is to convert the hierarchy of nodes to a Node Reference. You can do that by simply dragging the root node of the hierarchy to the desired folder in the Asset Browser. A corresponding *.node asset (source), containing the hierarchy, will be created in the folder. The node hierarchy will be replaced with a reference to this asset.

You can also convert a single node or a group of selected nodes in the World Nodes Hierarchy window via the context menu. To do so, select the desired node(s) in the World Nodes Hierarchy window, right-click on the selected node and choose Create a Node Reference. A corresponding *.node asset (source), containing the selected node (or a group of nodes as children with a Dummy Node as the root), will be created in the current folder opened in the Asset Browser. Selected nodes will be replaced with a reference to this asset.

3. Placing Instances#

So, we already have the first instance in the world. It's the one, that replaced the hierarchy, when we dragged it to the Asset Browser. To add other instances to the world, we can simply drag the desired *.node asset from the Asset Browser directly to the Scene Viewport.

Notice
The new instance will be placed at the origin.

Or you can simply clone a node reference, as any other node, via the Scene Viewport by moving it with a manipulator while holding the Shift key. In this case a new instance will be placed exactly where you point to.

4. Editing the Source Node from its Instances#

If you decide to change something in the source node, you can do that by editing any of its instances. To do so, perform the following steps:

  1. Select any instance in the world via the Scene Viewport or the World Nodes Hierarchy window. The parameters of the node reference will be displayed in the Parameters window.

  2. Click Edit. The hierarchy of the source node will be displayed in the World Nodes Hierarchy window.

  3. Edit the source node. You can make any changes: modify materials, add new nodes, remove existing ones, etc.

  4. Click Apply to save changes made to the source node or Cancel to discard them. The changes will be applied to all instances at once.

Notice
Modifying (resetting) the path to the Node Reference's baked lightmap will affect all instances of the Node Reference, and automatic replacement of the unique baked texture for each individual Node Reference won't be available anymore. (You will have to replace baked textures manually for each instance.)

Video Tutorial: Instancing Nodes#

Video Tutorial: Node References: Must-Knows#

Last update: 2024-08-16
Build: ()