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

Export System

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.

The Export System allows you to use default plugins and write custom ones to export UNIGINE’s nodes to a file of different format and store it on a disk.

The structure of Export System is shown below. It includes Export Manager and a dynamic set of exporters for various external file formats.

Export System

Export System Structure

Export Manager is used to create and manage exporters, as well as to directly export files to non-native formats, if an exporter for such files was previously registered.

Exporter#

Exporter is a module used by Export System to transfer UNIGINE’s objects to files in various non-native formats. A single exporter can be used to export multiple nodes, but there shouldn't be two or more exporters registered for a single node type.

Each exporter has a set of parameters that control the whole export process (e.g., whether to export lights, cameras, and material normal maps, reset root node transformation, etc.). The exporter should be initialized before the use.

Basic Workflow#

In order to be used, exporters must be registered in the system via Export Manager. You can manage the list of available modules dynamically by adding them to or removing from the registry. When you export a node to any external format, Export System automatically tries to find and use an appropriate exporter registered for the specified file extension.

The basic node export workflow is as follows:

  1. Check the extension of the specified output file and find the appropriate exporter among the registered ones.
  2. Extract scene data from the node, create the export scene and put the data to the corresponding export structures (e.g., fbx nodes).
  3. Use the appropriate exporter to generate output files on the basis of scene metadata.

Customization#

You can consider the FbxExporter plugin as an example to build your own custom exporting modules. You can also modify and rebuild this plugin to use your own custom exporter in the Editor.

To use the FbxExporter plugin, just load it via the plugin_load console command or the following command line option on the application start-up:

Shell commands
-extern_plugin FbxExporter

In general, the workflow via the C++ API may be represented as follows:

Source code (C++)
// create an exporter for the exported file ("1.fbx" in our case)
Unigine::Exporter* exporter = Unigine::Export::get()->createExporterByFileName("1.fbx");

// enable the "export_material_normal_maps" parameter 
exporter->setParameterInt("export_material_normal_maps", 1);

// initialize exporter
exporter->init();

// get the node
NodePtr node = World::getNodeByName("material_ball");

// export the node to the specified file path
exporter->doExport(node, "1.fbx");

// exporter deinitialization
exporter->deinit();

You can also export a node with default settings simply like this:

Source code (C++)
// get the node
NodePtr node = World::getNodeByName("material_ball");

// export the node to the file of specified format
Unigine::Export::get()->doExport(node, "../data/1/1.fbx")

Built-in Export Options#

The engine's built-in exporters (such as FbxExporter plugin) have a number of export options that customize the exporter’s behavior and can also be used in custom exporters.

Parameter Names#

The following table lists the names for the parameters available out of the box that can be set via the setParameterInt("name", value) method.

export_lights
Exports the light nodes.
  • 0 — disabled
  • 1 — to enable (by default)
export_cameras
Exports the camera nodes.
  • 0 — disable
  • 1 — enabled (by default)
export_material_normal_maps
Exports normal maps of materials.
  • 0 — disabled
  • 1 — to enable (by default)
reset_root_node_transformation
Resets the node’s root transformation.
  • 0 — disabled (by default)
  • 1 — to enable

See Also#

  • FbxExporter plugin as an a example for your custom export plugin: source/plugins/Export/FbxExporter.

Fbx Export System API:

  • FBX Export Functionality classes for more details on managing the Export System via code .

    Notice
    Export System API is not available for the Community SDK edition.
Last update: 13.12.2021
Build: ()