This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::ImportScene Class

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 instance.

int getNumNodes ( ) const#

Returns the total number of nodes in the imported scene.

Return value

Number of nodes in the imported scene.

Ptr<ImportNode> getNode ( int i ) const#

Returns a node contained in the imported scene by its index.

Arguments

Return value

Scene node with the specified index (ImportNode class instance if it exists).

Ptr<ImportNode> addNode ( const Ptr<ImportNode> & parent ) #

Adds a new node as an attribute to the specified scene graph node and returns the corresponding ImportNode instance.

Arguments

  • const Ptr<ImportNode> & parent - Scene graph node to add a new node to.

Return value

New added ImportNode class instance.

bool removeNode ( const Ptr<ImportNode> & node ) #

Removes the specified scene graph node.

Arguments

Return value

true if the specified scene graph node was successfully removed from the scene; otherwise false.

int getNumMeshes ( ) const#

Returns the total number of meshes in the imported scene.

Return value

Number of meshes in the imported scene.

Ptr<ImportMesh> getMesh ( int i ) const#

Returns a mesh contained in the imported scene by its index.

Arguments

Return value

Mesh with the specified index (ImportMesh class instance if it exists).

Ptr<ImportMesh> addMesh ( const Ptr<ImportNode> & node ) #

Adds a new mesh as an attribute to the specified imported node and returns the corresponding ImportMesh instance.

Arguments

  • const Ptr<ImportNode> & node - Scene graph node to add a new mesh to.

Return value

New added ImportMesh class instance.

void removeMesh ( const Ptr<ImportMesh> & mesh ) #

Removes the specified mesh from the list meshes of the imported scene.

Arguments

int getNumLights ( ) const#

Returns the total number of lights in the imported scene.

Return value

Number of lights in the imported scene.

Ptr<ImportLight> getLight ( int i ) const#

Returns a light source contained in the imported scene by its index.

Arguments

Return value

Light source with the specified index (ImportLight class instance if it exists).

Ptr<ImportLight> addLight ( const Ptr<ImportNode> & node ) #

Adds a new light as an attribute to the specified imported node and returns the corresponding ImportLight instance.

Arguments

  • const Ptr<ImportNode> & node - Scene graph node to add a light source camera to.

Return value

New added ImportLight class instance.

void removeLight ( const Ptr<ImportLight> & light ) #

Removes the specified light source from the list of light sources of the imported scene.

Arguments

int getNumCameras ( ) const#

Returns the total number of camera in the imported scene.

Return value

Number of cameras in the imported scene.

Ptr<ImportCamera> getCamera ( int i ) const#

Returns a camera contained in the imported scene by its index.

Arguments

Return value

Camera with the specified index (ImportCamera class instance if it exists).

Ptr<ImportCamera> addCamera ( const Ptr<ImportNode> & node ) #

Adds a new camera as an attribute to the specified imported node and returns the corresponding ImportCamera instance.

Arguments

  • const Ptr<ImportNode> & node - Scene graph node to add a new camera to.

Return value

New added ImportCamera class instance.

void removeCamera ( const Ptr<ImportCamera> & camera ) #

Removes the specified camera from the scene.

Arguments

int getNumAnimations ( ) const#

Returns the total number of animations in the imported scene.

Return value

Number of animations in the imported scene.

Ptr<ImportAnimation> getAnimation ( int i ) const#

Returns an animation contained in the imported scene by its index.

Arguments

Return value

Animation with the specified index (ImportAnimation class instance if it exists).

Ptr<ImportAnimation> addAnimation ( ) #

Adds a given animation to the scene and returns an instance of the added animation.

Return value

New added ImportAnimation class instance.

void removeAnimation ( const Ptr<ImportAnimation> & animation ) #

Removes the specified animation from the scene.

Arguments

int getNumMaterials ( ) const#

Returns the total number of materials in the imported scene.

Return value

Number of materials in the imported scene.

Ptr<ImportMaterial> getMaterial ( int i ) const#

Returns a material contained in the imported scene by its index.

Arguments

Return value

Material with the specified index (ImportMaterial class instance if it exists).

Ptr<ImportMaterial> addMaterial ( ) #

Adds a given material to the scene and returns an instance of the added material.

Return value

New added ImportMaterial class instance.

Ptr<ImportMaterial> getMaterial ( const char * name ) const#

Returns a material contained in the imported scene by its name.

Arguments

  • const char * name - Material name.

Return value

Material with the specified name (ImportMaterial class instance if it exists).

void replaceMaterial ( const Ptr<ImportMaterial> & old_material, const Ptr<ImportMaterial> & new_material ) #

Replaces the specified material contained in the imported scene with another one.

Arguments

void removeMaterial ( const Ptr<ImportMaterial> & material ) #

Removes the specified material from the scene.

Arguments

int getNumTextures ( ) const#

Returns the total number of textures in the imported scene.

Return value

Number of textures in the imported scene.

Ptr<ImportTexture> getTexture ( int i ) const#

Returns a texture contained in the imported scene by its index.

Arguments

Return value

Texture with the specified index (ImportTexture class instance if it exists).

Ptr<ImportTexture> getTexture ( const char * filepath ) #

Returns a texture contained in the imported scene by its file path.

Arguments

  • const char * filepath - Texture file path.

Return value

Texture with the specified file path (ImportTexture class instance if it exists).

Ptr<ImportTexture> findTexture ( const char * filepath ) const#

Returns a texture contained in the imported scene by its file path.

Arguments

  • const char * filepath - Texture file path.

Return value

Texture with the specified file path (ImportTexture class instance if it exists).
Last update: 2024-12-13
Build: ()