This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine Language Object Notation (ULON)

ULON (Unigine Language Object Notation) is a universal format used in UNIGINE to describe complex structures similar to classes in Object-Oriented Programming. Landscape Terrain brushes as well as some of UNIGINE built-in materials are described using ULON. ULON (Unigine Language Object Notation) - это универсальный формат, используемый в UNIGINE для описания сложных структур, подобных классам в объектно-ориентированном программировании. Кисти Landscape Terrain, а также некоторые из встроенных материалов UNIGINE описываются с помощью ULON.

The Engine supports loading and parsing files containing ULON-declarations, but does not support saving ULON-based structures to a file as such declarations are treated more like source code. Движок поддерживает загрузку и анализ файлов, содержащих объявления ULON, но не поддерживает сохранение структур на основе ULON в файл, поскольку такие объявления обрабатываются больше как исходный код.

ULON Description Example Пример описания ULON

ULON Description Example

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

NodesУзлы#

The basic element (building brick) of ULON is called a node. Each node has a type, a name, and a value.Базовый элемент ("кирпичик") ULON называется узлом (node). У каждого узла есть тип (type), имя (name) и значение (value).

The following construct is used to declare a node: Для объявления узла используется следующая конструкция:

ULON Node Declaration

Both node name and type are written as strings:

  • either a quoted string with standard escape characters,either a quoted string with standard escape characters,
  • or a bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_".or a bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_".
Here is an example:
Исходный код
"Node Type" "node name" = node_value
NodeType node_name1 = node_value
either a quoted string with standard escape characters,or a bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_".И узел name , и type записываются в виде строк:

  • either a quoted string with standard escape characters, либо строка в кавычках со стандартными escape-символами,
  • or a bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_". или простое слово , начинающееся со строчной буквы, содержащее только буквы, цифры и символы подчеркивания "_".
Вот пример:
Исходный код
"Node Type" "node name" = node_value
NodeType node_name1 = node_value

Node declarations can be nested, thus forming a hierarchy. So a node can have a parent and an unlimited number children.

Исходный код
Node parent
{
	Node child_0
	Node child_1
	{
		Node child_2
		Node child_3
	}
}
Объявления узлов могут быть вложенными, образуя иерархию. Таким образом, у узла может быть родитель и неограниченное количество дочерних элементов.

Исходный код
Node parent
{
	Node child_0
	Node child_1
	{
		Node child_2
		Node child_3
	}
}

ValuesЗначения#

ULON node values can be of the following types:

  • Boolean
    Node my_node = true
    Boolean
    Node my_node = true
  • Integer number
    Node my_node = 1234
    Integer number
    Node my_node = 1234
  • Floating-point number
    Node my_node = 3.1459
    Floating-point number
    Node my_node = 3.1459
  • String
    • Quoted string with standard escape characters:
      Node node = "word word"
      Quoted string with standard escape characters:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    Quoted string with standard escape characters:
    Node node = "word word"Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
    Node node = word1_word2 Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
    Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    String
    • Quoted string with standard escape characters:
      Node node = "word word"
      Quoted string with standard escape characters:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
  • Array containing a finite number of integer, float, and string elements
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
    This array has the following 6 elements:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;
    Array containing a finite number of integer, float, and string elements
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
    This array has the following 6 elements:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;
Boolean
Node my_node = true Integer number
Node my_node = 1234 Floating-point number
Node my_node = 3.1459 String
  • Quoted string with standard escape characters:
    Node node = "word word"
    Quoted string with standard escape characters:
    Node node = "word word"
  • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
    Node node = word1_word2
    Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
    Node node = word1_word2
  • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
    Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
    Node my_node = #{C++ C# USC HLSL GLSL USSL#}
Quoted string with standard escape characters:
Node node = "word word"Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
Node node = word1_word2 Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
Node my_node = #{C++ C# USC HLSL GLSL USSL#}Array containing a finite number of integer, float, and string elements
Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
This array has the following 6 elements:
  • 100
  • 0.2
  • str
  • str
  • str str str
  • vec4 asd = vec4_zero;
Значения узлов ULON могут быть следующих типов:

  • Boolean
    Node my_node = true
    Boolean
    Node my_node = true
  • Integer number
    Node my_node = 1234
    Целое число
    Node my_node = 1234
  • Floating-point number
    Node my_node = 3.1459
    Число с плавающей запятой
    Node my_node = 3.1459
  • String
    • Quoted string with standard escape characters:
      Node node = "word word"
      Quoted string with standard escape characters:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    Quoted string with standard escape characters:
    Node node = "word word"Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
    Node node = word1_word2 Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
    Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    String
    • Quoted string with standard escape characters:
      Node node = "word word"
      Строка в кавычках со стандартными escape-символами:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      Простое слово, начинающееся со строчной буквы, содержащее только буквы, цифры и символы подчеркивания "_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      Строка Heredoc, заключенная в #{ ... #}. Этот тип можно использовать для фрагментов кода (например, кода шейдера, встроенного в описание материала):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
  • Array containing a finite number of integer, float, and string elements
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
    This array has the following 6 elements:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;
    Массив , содержащий конечное число элементов integer, float и string
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
    Этот массив имеет следующие 6 элементов:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;

ArgumentsАргументы#

ULON argument is a name - value pair (name = value). Arguments are additional parameters that can be associated with ULON nodes and used for various purposes (e.g. to define a tooltip or a title for a material parameter declaration). Arguments are enclosed in angle brackets < > and can be separated using "\t","\n","\r", as well as commas and spaces. Аргумент ULON - это пара имя - значение ( name = value ). Аргументы - это дополнительные параметры, которые могут быть связаны с узлами ULON и использоваться для различных целей (например, для определения всплывающей подсказки или заголовка для объявления параметра материала). Аргументы заключаются в угловые скобки < > и могут быть разделены с помощью "\ t", "\ n", "\ r", а также запятых и пробелов.

Example:Пример:

ULON Arguments Declaration

ConditionsУсловия#

For each node a logical condition can be specified, if the condition fails the ULON node with all its children is ignored. Thus you can dynamically build the hierarchy of ULON nodes with a great degree of flexibility. This can be useful when the contents of the node depends on certain parameters, e.g. a shader to be used is defined by the rendering pass.

Примечание
Conditions are not parsed and executed automatically, processing of conditions is the responsibility of the user of the ULON format (e.g. in case of materials UnigineScript and UUSL are used).Conditions are not parsed and executed automatically, processing of conditions is the responsibility of the user of the ULON format (e.g. in case of materials UnigineScript and UUSL are used).
Conditions are specified after the node's name, starting with the if keyword, the condition itself is enclosed in brackets [ ... ]. Conditions are not parsed and executed automatically, processing of conditions is the responsibility of the user of the ULON format (e.g. in case of materials UnigineScript and UUSL are used). Для каждого узла может быть указано логическое условие, если условие не выполняется, узел ULON со всеми его дочерними элементами игнорируется. Таким образом, вы можете динамически строить иерархию узлов ULON с большой степенью гибкости. Это может быть полезно, когда содержимое узла зависит от определенных параметров, например шейдер, который будет использоваться, определяется этапом рендеринга.

Примечание
Conditions are not parsed and executed automatically, processing of conditions is the responsibility of the user of the ULON format (e.g. in case of materials UnigineScript and UUSL are used). Условия не анализируются и не выполняются автоматически, обработка условий является обязанностью пользователя формата ULON (например, в случае использования материалов UnigineScript и UUSL ) .
Условия указываются после имени узла, начиная с ключевого слова if, само условие заключено в скобки [ ... ].

Condition of the parent node is added to the condition of the child: (parent_conditon) && (child_conditon) К условию дочернего узла добавляется условие родительского узла: (parent_conditon) && (child_conditon)

Example:

Исходный код
Node parent if[var1 == 10 || var1 == 5]
{
	Node child_0  if[var2 == 3]
	Node child_1  if[var2 == 4]
	{
		Node child_2 if[var3 != 11]
		Node child_3 if[var3 != 25]
	}
}
The resulting conditions for each node are as follows:
  • parent condition: (var1 == 10 || var1 == 5)
  • child_0 condition: (var1 == 10 || var1 == 5) && (var2 == 3)
  • child_1 condition: (var1 == 10 || var1 == 5) && (var2 == 4)
  • child_2 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 11)
  • child_3 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 25)
Пример:

Исходный код
Node parent if[var1 == 10 || var1 == 5]
{
	Node child_0  if[var2 == 3]
	Node child_1  if[var2 == 4]
	{
		Node child_2 if[var3 != 11]
		ode child_3 if[var3 != 25]
	}
}
Итоговые условия для каждого узла следующие:
  • parent condition: (var1 == 10 || var1 == 5)
  • child_0 condition: (var1 == 10 || var1 == 5) && (var2 == 3)
  • child_1 condition: (var1 == 10 || var1 == 5) && (var2 == 4)
  • child_2 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 11)
  • child_3 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 25)

CommentsКомментарии#

Adding comments make object declaration easier to understand, especially if the object is a complex one. The following type os comments are supported: Добавление комментариев упрощает понимание объявления объекта, особенно если объект сложный. Поддерживаются следующие типы комментариев ОС:

  • single-line comments starting with "//":
    // This is a single-line comment
    однострочные комментарии, начинающиеся с "//":
    // This is a single-line comment
  • multi-line comments enclosed within "/*" and "*/":
    /* This is
    a multi-line
    comment */
    многострочные комментарии, заключенные в "/*" и "*/":
    / * Это
    многострочный
    комментарий * /
Последнее обновление: 09.04.2021
Build: ()