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
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::ImportScene 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 scene graphs to be imported. A scene graph is a tree of nodes. When it is first created, the node is "empty" (i.e: it is an object without any graphical representation that only contains the position information). In this state, it is used only to represent parents in the node tree structure. Normally other objects (cameras, lights, meshes,...) are added to nodes as attributes to specialize it. Node attribute is an object in itself and is connected to a node. The same node attribute can be shared among multiple nodes.

A scene can include the following components:

ImportScene Class

Members


ImportScene ( ) #

Constructor. Creates an empty import scene

ImportAnimation * addAnimation ( ) #

Adds a given animation to the scene and returns a pointer to the added animation.

Return value

ImportAnimation structure pointer.

ImportCamera * addCamera ( ImportNode* node ) #

Adds a new camera as an attribute to the specified scene graph node and returns a pointer to the added camera.

Arguments

  • ImportNode* node - Scene graph node to add a new camera to.

Return value

ImportCamera structure pointer.

ImportLight * addLight ( ImportNode* node ) #

Adds a new light as an attribute to the specified scene graph node and returns a pointer to the added light.

Arguments

  • ImportNode* node - Scene graph node to add a new light to.

Return value

ImportLight structure pointer.

ImportMaterial * addMaterial ( ) #

Adds a new material to the scene and returns a pointer to the added material.

Return value

ImportMaterial structure pointer.

ImportMesh * addMesh ( ImportNode* node ) #

Adds a new mesh as an attribute to the specified scene graph node and returns a pointer to the added mesh.

Arguments

  • ImportNode* node - Scene graph node to add a new mesh to.

Return value

ImportMesh structure pointer.

ImportNode * addNode ( ImportNode* parent ) #

Adds a new node as an attribute to the specified scene graph node and returns a pointer to the added node.

Arguments

  • ImportNode* parent - Scene graph node to add a new node to.

Return value

ImportNode structure pointer.

ImportAnimation * getAnimation ( int i ) const#

Returns the animation with a given index.

Arguments

Return value

ImportAnimation structure pointer.

const int & getAnimations ( ) const#

Returns a vector containing all scene animations.

Return value

Vector containing all scene animations as ImportAnimation structure pointers.

ImportCamera * getCamera ( int i ) const#

Returns the camera with a given index.

Arguments

Return value

ImportCamera structure pointer.

const int & getCameras ( ) const#

Returns a vector containing all scene cameras.

Return value

Vector containing all scene cameras as ImportCamera structure pointers.

ImportLight * getLight ( int i ) const#

Returns the light with a given index.

Arguments

Return value

ImportLight structure pointer.

const int & getLights ( ) const#

Returns a vector containing all scene lights.

Return value

Vector containing all scene lights as ImportLight structure pointers.

ImportMaterial * getMaterial ( int i ) const#

Returns the material with a given index.

Arguments

Return value

ImportMaterial structure pointer.

const int & getMaterials ( ) const#

Returns a vector containing all scene materials.

Return value

Vector containing all scene materials as ImportMaterial structure pointers.

ImportMesh * getMesh ( int i ) const#

Returns the mesh with a given index.

Arguments

Return value

ImportMesh structure pointer.

const int & getMeshes ( ) const#

Returns a vector containing all scene meshes.

Return value

Vector containing all scene meshes as ImportMesh structure pointers.

ImportNode * getNode ( int i ) const#

Returns the node with a given index.

Arguments

Return value

ImportNode structure pointer.

const int & getNodes ( ) const#

Returns a vector containing all scene graph nodes.

Return value

Vector containing all scene graph nodes as ImportNode structure pointers.

ImportTexture * getTexture ( int i ) const#

Returns the texture with a given index.

Arguments

Return value

ImportTexture structure pointer.

ImportTexture * getTexture ( const char* filepath ) #

Returns the node with a given file path.

Arguments

  • const char* filepath - Path to texture file.

Return value

ImportTexture structure pointer if it exists; otherwise, nullptr.

const int & getTextures ( ) const#

Returns a vector containing all scene textures.

Return value

Vector containing all scene textures as ImportTexture structure pointers.

int getNumAnimations ( ) const#

Returns the total number of animations in the scene.

Return value

Number of animations in the scene.

int getNumCameras ( ) const#

Returns the total number of cameras in the scene.

Return value

Number of cameras in the scene.

int getNumLights ( ) const#

Returns the total number of lights in the scene.

Return value

Number of lights in the scene.

int getNumMaterials ( ) const#

Returns the total number of materials in the scene.

Return value

Number of materials in the scene.

int getNumMeshes ( ) const#

Returns the total number of meshes in the scene.

Return value

Number of meshes in the scene.

int getNumNodes ( ) const#

Returns the total number of nodes in the scene.

Return value

Number of nodes in the scene.

int getNumTextures ( ) const#

Returns the total number of textures in the scene.

Return value

Number of textures in the scene.

void removeCamera ( ImportCamera* camera ) #

Removes the specified camera from the scene.

Arguments

void removeLight ( ImportLight* light ) #

Removes the specified light from the scene.

Arguments

void removeMaterial ( ImportMaterial* material ) #

Removes the specified material from the scene.

Arguments

void removeMesh ( ImportMesh* mesh ) #

Removes the specified mesh from the scene.

Arguments

void removeNode ( ImportNode* node ) #

Removes the specified node from the scene.

Arguments

ImportTexture * findTexture ( const char* filepath ) const#

Returns a texture used in the scene by its file path.

Arguments

  • const char* filepath - Path to a texture file.

Return value

ImportTexture structure corresponding to the specified file path if it exists; otherwise, nullptr.

void replaceMaterial ( ImportMaterial* old_material, ImportMaterial* new_material ) #

Replaces a given material in the scene with another one.

Arguments

void removeAnimation ( ImportAnimation* animation ) #

Removes the specified animation from the scene.

Arguments

ImportMaterial * getMaterial ( const char* name ) const#

Returns the material with a given name.

Arguments

  • const char* name - Name of the material.

Return value

ImportMaterial structure pointer.
Last update: 10.10.2022
Build: ()