This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Professional (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Materials and Shaders
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.

Unigine::ImportProcessor Class

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.
Header: #include <UnigineImport.h>

This class is used to manage import processors. An import processor is a module that saves objects generated by an importer on the basis of metadata on the whole scene or some of its components to files in UNIGINE native format and performs auxiliary operations during the import process (data preparation, file management, etc.). You can use a set of different processors for each scene component or a single processor for all of them. There are also two specific types of processors:

  • Pre-processors - perform additional operations with scene metadata prior to generation of UNIGINE's objects.
  • Post-processors - perform additional operations with files generated in the process of import (e.g. copying files to other folders, adding files to packages, etc.).

Notice
This is a base class for all import processors. Your custom import processor class must be inherited from it.

You can override one (or all) onProcess*() methods to define the types of components to be processed by it, these overridden methods will be called by the importer when corresponding import operations are performed.

Notice
For pre- and post-processors only the onProcessScene() method is to be overridden.

ImportProcessor Class

Members


ImportProcessor ( ) #

Constructor. Creates an empty import processor.

Ptr<ImportProcessor> getImportProcessor ( ) const#

Returns the import processor itself.

Return value

Import processor itself.

void setImporter ( const Ptr<Importer> & importer ) #

Sets the importer for the import processor.

Arguments

Ptr<Importer> getImporter ( ) const#

Returns the importer for the import processor.

Return value

Importer currently used.

void setOutputPath ( const char * path ) #

Sets the specified output path to be used to put files with imported scene elements to.

Arguments

  • const char * path - Output path to be set.

const char * getOutputPath ( ) const#

Returns the current output path used to put files with imported scene elements to.

Return value

Current output path.

bool processScene ( const Ptr<ImportScene> & scene ) #

Performs scene processing: modifies the metadata of scene elements or files generated in the process of importing the scene.
Notice
This method is used by pre-processors and post-processors. To customize actions to be performed on scene processing, when implementing a custom pre- or post-processor, you can override the onProcessScene() method.

Arguments

Return value

true if the specified scene is successfully processed; otherwise, false.

bool processTexture ( const Ptr<ImportTexture> & import_texture ) #

Performs texture processing: saves the specified generated texture to a corresponding file in the output directory.
Notice
To customize actions to be performed on texture processing, when implementing a custom import processor, you can override the onProcessTexture() method.

Arguments

Return value

true if the specified texture is successfully imported to a file; otherwise, false.

bool processMesh ( const Ptr<Mesh> & mesh, const Ptr<ImportMesh> & import_mesh ) #

Performs mesh processing: saves the specified generated mesh to a corresponding *.mesh file in the output directory.
Notice
To customize actions to be performed on mesh processing, when implementing a custom import processor, you can override the onProcessMesh() method.

Arguments

Return value

true if the specified mesh is successfully imported to a file; otherwise, false.

bool processLight ( const Ptr<Light> & light, const Ptr<ImportLight> & import_light ) #

Performs light processing: saves the specified generated light source to a corresponding file in the output directory.
Notice
To customize actions to be performed on light processing, when implementing a custom import processor, you can override the onProcessLight() method.

Arguments

Return value

true if the specified light is successfully processed; otherwise, false.

bool processCamera ( const Ptr<Player> & camera, const Ptr<ImportCamera> & import_camera ) #

Performs camera processing: saves the specified generated player to a corresponding file in the output directory.
Notice
To customize actions to be performed on camera processing, when implementing a custom import processor, you can override the onProcessCamera() method.

Arguments

Return value

true if the specified camera is successfully processed; otherwise, false.

bool processAnimation ( const Ptr<Mesh> & animation, const Ptr<ImportAnimation> & import_animation ) #

Performs mesh animation processing: saves the specified generated mesh animation to a corresponding file in the output directory.
Notice
To customize actions to be performed on mesh animation processing, when implementing a custom import processor, you can override the onProcessAnimation() method.

Arguments

Return value

true if the specified animation is successfully processed; otherwise, false.

bool processAnimation ( const Ptr<Mesh> & animation, const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) #

Performs mesh animation processing: saves the specified generated mesh animation to a corresponding file in the output directory.
Notice
To customize actions to be performed on mesh animation processing, when implementing a custom import processor, you can override the onProcessAnimation() method.

Arguments

Return value

true if the specified animation is successfully processed; otherwise, false.

bool processNode ( const Ptr<Node> & node, const Ptr<ImportNode> & import_node ) #

Performs node processing: saves the specified generated node to a corresponding *.node file in the output directory.
Notice
To customize actions to be performed on node processing, when implementing a custom import processor, you can override the onProcessNode() method.

Arguments

Return value

true if the specified node is successfully processed; otherwise, false.

bool processNodeChild ( const Ptr<Node> & node_parent, const Ptr<ImportNode> & import_node_parent, const Ptr<Node> & node_child, const Ptr<ImportNode> & import_node_child ) #

Performs node processing: saves the specified generated node along with the specified child to a corresponding *.node file in the output directory.
Notice
To customize actions to be performed on node processing, when implementing a custom import processor, you can override the onProcessNodeChild() method.

Arguments

Return value

true if the specified parent node with its specified child node is successfully processed; otherwise, false.

bool processMaterial ( const Ptr<Material> & material, const Ptr<ImportMaterial> & import_material ) #

Performs material processing: saves the specified generated material to a corresponding file in the output directory.
Notice
To customize actions to be performed on material processing, when implementing a custom import processor, you can override the onProcessMaterial() method.

Arguments

Return value

true if the specified material is successfully processed; otherwise, false.

bool onProcessScene ( const Ptr<ImportScene> & scene ) #

Scene processing event handler function. This function is called each time when the processScene() function is called. You can specify your custom actions to be performed: modify the metadata of scene elements (pre-process) or files generated in the process of importing the scene (post-process).
Notice
This method is used by pre-processors and post-processors.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessScene(ImportScene *scene) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessScene(ImportScene *scene)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified scene is successfully processed; otherwise, false.

bool onProcessTexture ( const Ptr<ImportTexture> & import_texture ) #

Texture processing event handler function. This function is called each time when the processTexture() function is called. You can specify your custom actions to be performed on texture processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessTexture(ImportTexture *import_texture) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessTexture(ImportTexture *import_texture)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified texture is successfully processed; otherwise, false.

bool onProcessMesh ( const Ptr<Mesh> & mesh, const Ptr<ImportMesh> & import_mesh ) #

Mesh processing event handler function. This function is called each time when the processMesh() function is called. You can specify your custom actions to be performed on mesh processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessMesh(MeshPtr &mesh, ImportMesh *import_mesh) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessMesh(MeshPtr &mesh, ImportMesh *import_mesh)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified mesh is successfully processed; otherwise, false.

bool onProcessLight ( const Ptr<Light> & light, const Ptr<ImportLight> & import_light ) #

Light processing event handler function. This function is called each time when the processLight() function is called. You can specify your custom actions to be performed on light processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessLight(LightPtr &light, ImportLight *import_light) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessLight(LightPtr &light, ImportLight *import_light)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified light is successfully processed; otherwise, false.

bool onProcessCamera ( const Ptr<Player> & camera, const Ptr<ImportCamera> & import_camera ) #

Camera processing event handler function. This function is called each time when the processCamera() function is called. You can specify your custom actions to be performed on camera processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessCamera(PlayerPtr &camera, ImportCamera *import_camera) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessCamera(PlayerPtr &camera, ImportCamera *import_camera)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified camera is successfully processed; otherwise, false.

bool onProcessAnimation ( const Ptr<Mesh> & animation, const Ptr<ImportAnimation> & import_animation ) #

Animation processing event handler function. This function is called each time when the processAnimation() function is called. You can specify your custom actions to be performed on animation processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessAnimation(MeshPtr &animation, ImportMesh *import_mesh, ImportAnimation *import_animation) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessAnimation(MeshPtr &animation, ImportMesh *import_mesh, ImportAnimation *import_animation)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified animation is successfully processed; otherwise, false.

bool onProcessAnimation ( const Ptr<Mesh> & animation, const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) #

Animation processing event handler function. This function is called each time when the processAnimation() function is called. You can specify your custom actions to be performed on animation processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessAnimation(MeshPtr &animation, ImportMesh *import_mesh, ImportAnimation *import_animation) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessAnimation(MeshPtr &animation, ImportMesh *import_mesh, ImportAnimation *import_animation)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified animation is successfully processed; otherwise, false.

bool onProcessNode ( const Ptr<Node> & node, const Ptr<ImportNode> & import_node ) #

Node processing event handler function. This function is called each time when the processNode() function is called. You can specify your custom actions to be performed on node processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessNode(NodePtr &node, ImportNode *import_node) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessNode(NodePtr &node, ImportNode *import_node)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified node is successfully processed; otherwise, false.

bool onProcessNodeChild ( const Ptr<Node> & node_parent, const Ptr<ImportNode> & import_node_parent, const Ptr<Node> & node_child, const Ptr<ImportNode> & import_node_child ) #

Node processing event handler function for node hierarchies. This function is called each time when the processNodeChild() function is called. You can specify your custom actions to be performed on node processing (e.g. assigning properties to node's children).
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessNodeChild(const NodePtr &node_parent, const ImportNodePtr &import_node_parent, const NodePtr &node_child, const ImportNodePtr &import_node_child) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessNode(NodePtr &node, ImportNode *import_node)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified parent node is successfully processed with its specified child node; otherwise, false.

bool onProcessMaterial ( const Ptr<Material> & material, const Ptr<ImportMaterial> & import_material ) #

Material processing event handler function. This function is called each time when the processMaterial() function is called. You can specify your custom actions to be performed on material processing.
Source code (C++)
class MyCustomProcessor : public Unigine::ImportProcessor
{
public:
	MyCustomProcessor();
	virtual ~MyCustomProcessor();

/*...*/

// overrides of event functions
protected:
	virtual bool onProcessMaterial(MaterialPtr &material, ImportMaterial *import_material) override;

/*...*/

};

/*...*/

bool MyCustomProcessor::onProcessMaterial(MaterialPtr &material, ImportMaterial *import_material)
{
	bool result = false;
	
	// your custom actions
	
	return result;
}

Arguments

Return value

true if the specified material is successfully processed; otherwise, false.
Last update: 14.12.2022
Build: ()