This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
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
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Node Reference

Node Reference is a node that refers to a .node file in the project directory, which is obtained by exporting a node from the world. Node Reference - это нода, которая ссылается на файл .node в каталоге проекта, получаемый путем экспорта ноды из мира.

Примечание
The world can contain several Node References referring to the same .node file.Мир может содержать несколько Node References, ссылающихся на один и тот же файл .node.

The .node file usually contains a pre-fabricated node (or a hierarchy of nodes) with links to all materials and properties and configured physical bodies that are required for its rendering and behaviour. All changes made for the Node Reference content via UnigineEditor are saved into this file.Файл .node обычно содержит предварительно заготовленную ноду (или иерархию нод) со ссылками на все материалы и свойства, а также сконфигурированные физические тела, которые требуются для его визуализации и поведения. Все изменения, внесенные в содержимое Node Reference с помощью UnigineEditor, сохраняются в этом файле.

Node References should be used if a lot of identical objects are placed in the world: unlike regular nodes, Node Reference are loaded into the world faster because of the internal cache usage.Node References следует использовать, если в мире размещено много идентичных объектов: в отличие от обычных нод, Node Reference загружаются в мир быстрее благодаря использования внутреннего кэша.

Using Node Reference enables to avoid manual editing each identical object if you need to make the same changes in all of them. You can simply add several Node References that point to one .node file and then edit only one Node Reference in order to update them all. Such approach enables to hold to integrity of instanced objects, especially if they are complex and sophisticated.Использование Node Reference позволяет избежать ручного редактирования каждого из идентичных объектов, если вам нужно внести одинаковые изменения во все. Вы можете просто добавить несколько Node References, которые указывают на один файл .node, а затем отредактировать только один Node Reference, чтобы обновить их все. Такой подход позволяет сохранить целостность создаваемых объектов, особенно если они сложные и изощренные.

Примечание
Each Node References has its internal copy of nodes loaded from the .node asset, therefore all node references are updated only when saving changes to the asset.Каждый Node References имеет свою внутреннюю копию нод, загруженных из ассета .node, поэтому все ссылки на ноды обновляются только при сохранении изменений в ассете.

For example, the Node Reference can be used to add identical vehicles, characters, or buildings that should have the same look and behaviour and be updated at once, if necessary.Например, Node Reference можно использовать для добавления идентичных транспортных средств, персонажей или зданий, которые должны иметь одинаковый внешний вид и поведение и при необходимости сразу обновляться.

Boats added as Node ReferencesЛодки, добавленные в качестве Node References

Node References support nesting, i.e. a Node Reference can include other Node References which is helpful for implementing complex instancing solutions.Node References поддерживает вложенность, т.е. Node Reference может включать в себя другой Node References, что полезно для реализации сложных решений для создания экземпляров.

Watch the following tutorial to learn the important things about Node Reference:В следующем видеоуроке показаны важные моменты, которые необходимо знать о Node Reference:

Important NotesВажные примечания#

Примечание
A Node Reference can contain only one root node.Node Reference может содержать только одну корневую ноду.

Referencing Content OutsideСсылка на содержимое Node Reference извне#

A Node Reference should be thought of as a container for a self-sufficient hierarchy of nodes. When designing your world in UnigineEditor, avoid referencing nodes that are stored in a Node Reference directly from the outside (e.g. when manipulating nodes via Tracker, creating physical joints, specifying nodes in component parameters or the target node of a Player Persecutor) as such references will be lost as soon as the world is reloaded.Node Reference следует рассматривать как контейнер для самодостаточной иерархии нод. При проектировании вашего мира в UnigineEditor избегайте ссылок на ноды, которые хранятся в Node Reference, непосредственно извне (например, при манипулировании нодами через Tracker, создании физических сочленений, указании нод в параметрах компонента или в целевую ноду Player Persecutor), поскольку такие ссылки будут потеряны сразу после перезагрузки мира.

TransformationsТрансформации#

The transformation of a Node Reference is not affected by the transformation of the nodes stored by it. Thus, logic-driven and physics-driven nodes inside a Node Reference will make no influence on its direct children.Трансформации Node Reference не зависят от трансформаций хранимых в ней нод. Таким образом, управляемые логикой и физикой ноды внутри Node Reference не будут оказывать никакого влияния на его прямых дочерних элементов.

In the following example, the moving grouped Node_1 and Node_2 nodes (e.g. driven by physics) contained by a Node Reference will not modify the transformation of the Node Reference and, therefore, the DirectChild node will not be affected as well.В следующем примере движущиеся сгруппированные ноды Node_1 и Node_2 (например, управляемые физикой), содержащиеся в Node Reference, не изменят трансформацию Node Reference и, следовательно, нода DirectChild также не изменит своего положения.

Schematic representation of a Node Reference content.Схематическое представление содержимого Node Reference.

So, it is recommended to enclose all interconnected nodes in a single Node Reference to ensure logical and hierarchical integrity.Таким образом, рекомендуется заключить все взаимосвязанные ноды в один Node Reference для обеспечения логической и иерархической целостности.

See AlsoСмотрите также#

  • The Instancing Nodes article to learn more about using Node References to create identical objects.В статье Instancing Nodes вы узнаете больше об использовании Node References для создания идентичных объектов.
  • The NodeReference class to edit Node References via APIКласс NodeReference для редактирования Node References через API
  • The Randomizer plugin to work with multiple Node ReferencesПлагин Randomizer для работы с несколькими Node References
  • Node References: Must-Knows demonstrating the specifics of Node ReferenceВидео Node Reference: Важные моменты, демонстрирующие специфику работы с Node Reference

Creating a Node ReferenceСоздание Node Reference#

There are two ways to create a Node Reference via UnigineEditor:Есть два способа создать Node Reference с помощью UnigineEditor:

  • Create a Node Reference from a previously created .node asset. In this case, you should export a node into a .node file first.Создать Node Reference из ранее созданного .node ассета. В этом случае вам следует сначала экспортировать ноду в файл .node.

  • Convert a node with all its child nodes present in the nodes hierarchy list into a Node Reference. In this case, the source node will change its type to a Node Reference. Преобразовать ноду со всеми ее дочерними нодами, присутствующими в иерархии, в Node Reference. В этом случае исходная нода изменит свой тип на Node Reference.

By Using a Node AssetС помощью node-ассета#

  1. Export a node into a .node file or import the desired node file to the project. Экспортируйте ноду в файл .node или импортируйте нужный файл .node в проект.
  2. Add the Node Reference to the world by either of the following ways:Добавьте Node Reference в мир любым из следующих способов:

    • On the Menu bar, click Create -> Node -> Reference and select the desired .node asset in the window that opens:В меню нажмите Create -> Node -> Reference и выберите нужный ассет .node в открывшемся окне:

      Внимание
      It is not recommended to select a geometry container (.fbx, .dae, .gtlf, etc.) as the changes made to its node runtime will not be saved when reimporting the asset.Не рекомендуется выбирать контейнер геометрии (.fbx, .dae, .gtlf и т.д.), поскольку изменения, внесенные в его рантайм, не будут сохранены при повторном импорте ассета.
    • Drag the .node asset from the Asset Browser window.Перетащите ассет .node из окна Asset Browser.

You can repeat Step 2 in order to add the required number of Node References. Or you can simply clone the added node.Вы можете повторить шаг 2, чтобы добавить необходимое количество Node References. Или вы можете просто клонировать добавленную ноду.

Several Node References with the red material appliedНесколько NodeReference с нанесенным красным материалом

By Converting an Existing NodeПутем преобразования существующей ноды#

  1. Select a node in the World Nodes Hierarchy window (or directly in the scene).Выберите ноду в окне World Nodes Hierarchy (или непосредственно в сцене).
  2. On the Menu bar, click Edit -> Convert to NodeReference (or press Ctrl+Shift+G).В меню выберите Edit -> Convert to NodeReference (или нажмите Ctrl+Shift+G).

As a result, a new .node asset is created at the current folder and the source node is converted into the Node Reference:В результате в текущей папке создается новый ассет .node, а исходная нода преобразуется в Node Reference:

Source node to be convertedИсходная нода, подлежащая преобразованию
Converted nodeПреобразованная нода

You can also clone the converted node in order to get the required number of Node References.Вы также можете клонировать преобразованную ноду, чтобы получить требуемое количество Node Reference.

Примечание
If you select several nodes and convert them into a Node Reference, they are saved into a .node file as child nodes of a Dummy Node.Если вы выберете несколько нод и преобразуете их в Node Reference, они будут сохранены в файле .node как дочерние ноды Dummy Node.
Source nodes to be convertedИсходные ноды, подлежащие преобразованию
Nodes grouped under a Dummy Node to which Node Reference refersНоды, сгруппированные под Dummy Node, на которые ссылается Node Reference

Editing a Node ReferenceРедактирование Node Reference#

In the Reference section of the Node tab, you can change the asset of the source node or open the ReferenceNode Editor used to edit the source node: В разделе Reference вкладки Node вы можете заменить исходный ассет ноды на другой или открыть ReferenceNode Editor для редактирования исходной ноды:

A node assetnode-ассет

To edit the source node, to which the Node Reference points:Чтобы отредактировать исходную ноду, на который указывает Node Reference:

  1. Select the Node Reference in the World Nodes Hierarchy window.Выберите Node Reference в окне World Nodes Hierarchy.
  2. Click Edit in the Node tab of the Parameters window.Нажмите Edit на вкладке Node окна Parameters.

    The source node becomes available in the World Nodes Hierarchy window as a child of the Node Reference and can be edited via the Parameters window.Исходная нода появится в окне World Nodes Hierarchy как дочерняя нода Node Reference и может быть отредактирована через окно Parameters.

    World Nodes Hierarchy window: source node in the edit modeОкно World Nodes Hierarchy: исходная нода в режиме редактирования
  3. Edit the source node. For example, you can change the material applied to it:Отредактируйте исходную ноду. Например, вы можете изменить примененный к нему материал:

    Node References with the red material appliedNode Reference с нанесенным красным материалом
    Node References with the changed materialNode Reference с измененным материалом

    You can also reorganize hierarchy and replace the source nodes, but keep note that only the first child will be saved in the Node Reference as Node Reference can contain only one root node.Вы также можете реорганизовать иерархию и заменить исходные ноды, но имейте в виду, что в Node Reference будет сохранен только первую дочернюю ноду, поскольку Node Reference может содержать только один корневой узел.

  4. After all changes are made, select the parent node in the World Nodes Hierarchy window and click Apply to save changes to the source node or Cancel changes to keep nodes unchanged.После внесения всех изменений выберите родительскую ноду в окне World Nodes Hierarchy и нажмите Apply, чтобы сохранить изменения в исходной ноде, или Отменить изменения, чтобы сохранить ноды неизменными.

    Reference section in the Node tab of the parent Node Referenceраздел Reference на вкладке Node ссылки на родительскую ноду

It is also possible to quick-replace the source node with another one stored in the same folder. To do that, select a Node Reference in the World Nodes Hierarchy window or the Viewport, hold Shift and use the mouse wheel or Page Up and Page Down buttons.Также возможно быстро заменить исходную ноду другой, хранящейся в той же папке. Для этого выберите Node Reference в окне World Nodes Hierarchy или во вьюпорте, удерживайте Shift и используйте колесико мыши или кнопки Page Up и Page Down.

Deleting a Node ReferenceУдаление Node Reference#

You can delete the Node Reference the same way as any other node.Вы можете удалить Node Reference таким же образом, как и любую другую ноду.

Последнее обновление: 25.04.2023
Build: ()