This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
创建内容
Content Optimization
Materials
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: 2021-12-13
Build: ()