This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

ObjectMeshStatic Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Inherits from: Object

This class is used for handling static meshes.

See Also#

A set UnigineScript API samples located in the <UnigineSDK>/data/samples/objects/ folder:

ObjectMeshStatic Class

Members


static ObjectMeshStatic ( string path ) #

ObjectMeshStatic constructor. Creates a Static Mesh object with mesh loaded from the specified file.

Arguments

  • string path - Path to the base .mesh-file.

static ObjectMeshStatic ( ) #

ObjectMeshStatic constructor. Creates an empty Static Mesh object.

void setMeshPath ( string path ) #

Sets the new path to the base mesh. Does not update mesh immediately using the new path. If the mesh is in the procedural mode, it will be reset.

Arguments

  • string path - Path to the base .mesh-file.

string getMeshPath ( ) #

Returns the path to the current base mesh file.

Return value

Path to the base .mesh-file.

void applyMeshProcedural ( Mesh mesh ) #

Sets the specified mesh as the base mesh for the object. The object must be in the procedural mesh mode.

Arguments

  • Mesh mesh - Mesh to be applied.

void setLightmapEnabled ( int enabled, int surface ) #

Sets a value indicating if lightmapping is to be enabled for the surface with the specified number.

Arguments

  • int enabled - 1 to enable lightmapping for the surface with the specified number, or 0 - to disable.
  • int surface - Mesh surface number.

int isLightmapEnabled ( int surface ) #

Returns a value indicating if lightmapping is enabled for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

1 if lightmapping is enabled for the surface with the specified number;otherwise, 0.

void setLightmapMode ( int mode, int surface ) #

Sets a new lightmap mode for the surface with the specified number.

Arguments

  • int mode - New lightmap mode to be set for the surface with the specified number. One of the LIGHTMAP_MODE values.
  • int surface - Mesh surface number.

int getLightmapMode ( int surface ) #

Returns the current lightmap mode for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

Current lightmap mode for the surface with the specified number. One of the LIGHTMAP_MODE values.

void setLightmapSourceSurface ( int source_surface, int surface ) #

Sets a new source mesh surface number for the surface with the specified number. A lightmap texture generated for the source mesh surface shall be used for the specified surface (available only when the lightmap mode for the surface is set to LIGHTMAP_MODE_SURFACE mode. This can be used as optimization for LODs.

Arguments

  • int source_surface - Source mesh surface number.
  • int surface - Mesh surface number.

int getLightmapSourceSurface ( int surface ) #

Returns the current source mesh surface number for the surface with the specified number. A lightmap texture generated for the source mesh surface is used for the specified surface (available only when the lightmap mode for the surface is set to LIGHTMAP_MODE_SURFACE mode. This can be used as optimization for LODs.

Arguments

  • int surface - Mesh surface number.

Return value

Source mesh surface number.

int isLightmapCompression ( int surface ) #

Returns a value indicating if the lightmap texture baked for the surface with the specified number is to be compressed. Compressed lightmaps are lightweight, but please note that some compression artifacts may appear.

Arguments

  • int surface - Mesh surface number.

Return value

1 if the lightmap texture baked for the surface with the specified number is to be compressed; otherwise, 0.

void setLightmapCompression ( int enabled, int surface ) #

Sets a value indicating if the lightmap texture baked for the surface with the specified number is to be compressed. Compressed lightmaps are lightweight, but please note that some compression artifacts may appear.

Arguments

  • int enabled - 1 to enable compression for the lightmap texture baked for the surface with the specified number, or 0 - to disable.
  • int surface - Mesh surface number.

void setLightmapQuality ( int quality, int surface ) #

Sets a new lightmap baking quality preset for the surface with the specified number.

Arguments

  • int quality - New lightmap baking quality preset to be used for the surface with the specified number. One of the LIGHTMAP_QUALITY values.
  • int surface - Mesh surface number.

int getLightmapQuality ( int surface ) #

Returns the current lightmap baking quality preset for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

Current lightmap baking quality preset for the surface with the specified number. One of the LIGHTMAP_QUALITY values.

void setLightmapTexturePath ( string path, int surface ) #

Sets a new path to the baked lightmap texture to be used for the surface with the specified number. You can use this method to specify a lightmap texture generated in a third-party software.

Arguments

  • string path - Path to the baked lightmap texture to be used for the surface with the specified number.
  • int surface - Mesh surface number.

string getLightmapTexturePath ( int surface ) #

Returns the path to the baked lightmap texture currently used for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

Path to the baked lightmap texture currently used for the surface with the specified number.

void setSurfaceCustomTextureEnabled ( int enabled, int surface ) #

Sets a value indicating if a custom texture is to be used for the surface with the specified number.

Arguments

  • int enabled - 1 to enable using the custom texture for the surface with the specified number, or 0 - to disable.
  • int surface - Mesh surface number.

int isSurfaceCustomTextureEnabled ( int surface ) #

Returns a value indicating if a custom texture is to be used for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

1 if a custom texture is to be used for the surface with the specified number; otherwise, 0.

void setSurfaceCustomTextureMode ( int mode, int surface ) #

Sets a new mode for the custom texture of the surface with the specified number. This mode defines the source of the custom texture for the surface: either use a unique custom texture, or use a custom texture that is assigned to another surface of the mesh.

Arguments

  • int mode - Custom texture mode to be set for the surface with the specified number. One of the SURFACE_CUSTOM_TEXTURE_MODE_ values.
  • int surface - Mesh surface number.

int getSurfaceCustomTextureMode ( int surface ) #

Returns the current mode for the custom texture of the surface with the specified number. This mode defines the source of the custom texture for the surface: either use a unique custom texture, or use a custom texture that is assigned to another surface of the mesh.

Arguments

  • int surface - Mesh surface number.

Return value

Current custom texture mode for the surface with the specified number. One of the SURFACE_CUSTOM_TEXTURE_MODE_ values.

void setSurfaceCustomTextureSourceSurface ( int source_surface, int surface ) #

Sets a new source mesh surface number for the surface with the specified number. A custom texture generated for the source mesh surface shall be used for the specified surface (available only when the custom texture mode for the surface is set to SURFACE_CUSTOM_TEXTURE_MODE_SURFACE. This can be used as optimization for LODs.

Arguments

  • int source_surface - Source mesh surface number.
  • int surface - Mesh surface number.

int getSurfaceCustomTextureSourceSurface ( int surface ) #

Returns the current source mesh surface number for the surface with the specified number. A custom texture generated for the source mesh surface is used for the specified surface (available only when the custom texture mode for the surface is set to SURFACE_CUSTOM_TEXTURE_MODE_SURFACE. This can be used as optimization for LODs.

Arguments

  • int surface - Mesh surface number.

Return value

Source mesh surface number.

void setSurfaceCustomTexturePath ( string path, int surface ) #

Sets a new path to the custom texture to be used for the surface with the specified number. You can use this method to specify a texture generated in a third-party software.

Arguments

  • string path - Path to the custom texture to be assigned to the surface with the specified number.
  • int surface - Mesh surface number.

string getSurfaceCustomTexturePath ( int surface ) #

Returns the path to the custom texture currently assigned to the surface with the specified index.

Arguments

  • int surface - Mesh surface number.

Return value

Path to the custom texture currently assigned to the surface with the specified number.

void setSurfaceCustomTexture ( Texture texture, int surface ) #

Sets a new texture to be used as a custom texture for the surface with the specified number. You can use this method to set any texture.

Arguments

  • Texture texture - Texture to be set.
  • int surface - Mesh surface number.

Texture getSurfaceCustomTexture ( int surface ) #

Returns the texture currently used as a custom texture for the surface with the specified number.

Arguments

  • int surface - Mesh surface number.

Return value

Texture used as a custom texture for the specified surface.

MeshStatic getMeshInfo ( ) #

Returns the base mesh that stores data on mesh bounds, surfaces, their number, names, and bounds, but doesn't contain any geometry.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

MeshStatic getMeshForce ( ) #

Returns the base mesh used for the object. The returned static mesh won't be loaded to VRAM.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

MeshStatic getMeshAsync ( ) #

Returns the base mesh used for the object asynchronously. This function can be called if the mesh hasn't been loaded yet.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

MeshStatic getMeshForceVRAM ( ) #

Returns the base mesh used for the object and loads it to video memory (VRAM) immediately. At that, the static mesh will also be loaded to memory (RAM).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

A base static mesh used for the object.

MeshStatic getMeshAsyncVRAM ( ) #

Returns the base mesh used for the object asynchronously and loads it to video memory (VRAM). At that, the static mesh will also be loaded to memory (RAM).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

A base static mesh used for the object.

int loadAsyncVRAM ( ) #

Asynchronously loads the mesh to video memory (VRAM) if the async streaming mode for meshes is enabled. Otherwise, the forced loading is performed. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to video memory before they are used).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

1 if the mesh is loaded successfully, otherwise 0. If the mesh is already loaded to VRAM, 1 will be returned.

int loadAsyncRAM ( ) #

Asynchronously loads the mesh to memory (RAM) if the async streaming mode for meshes is enabled. Otherwise, the forced loading is performed. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Return value

1 if the mesh is loaded successfully, otherwise 0. If the mesh is already loaded to RAM, 1 will be returned.

int loadForceVRAM ( ) #

Performs force-loading of the mesh to video memory (VRAM) immediately.
Notice
Loading to VRAM must be performed in the main thread only.

Return value

1 if the mesh is loaded successfully, otherwise 0. If the mesh is already loaded to VRAM, 1 will be returned.

int loadForceRAM ( ) #

Performs force-loading of the mesh to memory (RAM) immediately.

Return value

1 if the mesh is loaded successfully, otherwise 0. If the mesh is already loaded to RAM, 1 will be returned.

int asyncCalculateNodes ( int surface ) #

Asynchronously calculates the mesh surface internal spatial tree used for quick calculation of collisions and intersections. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Arguments

  • int surface - Mesh surface number.

Return value

true if the internal tree is calculated successfully; otherwise, false.

int asyncCalculateEdges ( int surface ) #

Asynchronously calculates the edges of the mesh surface geometry. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Arguments

  • int surface - Mesh surface number.

Return value

true if the edges are calculated successfully; otherwise, false.

void setMeshProceduralMode ( int meshproceduralmode ) #

Sets a value indicating if the base mesh used for the object is procedural. A procedural mesh is a mesh created via code, such meshes have a specific streaming mode - they are always kept in memory after creation and never unloaded until the object is destroyed via code or the mesh returns to its normal mode (streaming from a source file). Changing of the base static mesh is possible only if it is in the procedural mode.

Arguments

  • int meshproceduralmode - 1 to switch the base mesh used for the object to procedural mode; otherwise, 0 - normal mode (the base mesh is streamed from a source file).

int isMeshProceduralMode ( ) #

Returns a value indicating if the base mesh used for the object is procedural. A procedural mesh is a mesh created via code, such meshes have a specific streaming mode - they are always kept in memory after creation and never unloaded until the object is destroyed via code or the mesh returns to its normal mode (streaming from a source file). Changing of the base static mesh is possible only if it is in the procedural mode.

Return value

1 if the base mesh used for the object is procedural; otherwise, 0 - normal mode (the base mesh is streamed from a source file).

int isMeshNull ( ) #

Returns a value indicating if the base mesh used for the object is null (does not exist, unassigned, not loaded, etc.).

Return value

1 if the base mesh used for the object is null; otherwise, 0.

int isMeshLoadedRAM ( ) #

Returns a value indicating if the base mesh used for the object is loaded to memory (RAM).

Return value

1 if the base mesh used for the object is loaded to RAM; otherwise, 0.

int isMeshLoadedVRAM ( ) #

Returns a value indicating if the base mesh used for the object is loaded to video memory (VRAM).

Return value

1 if the base mesh used for the object is loaded to VRAM; otherwise, 0.

void setMeshStreamingModeRAM ( int meshstreamingmoderam ) #

Sets the streaming mode for loading the mesh to memory (RAM).

Arguments

  • int meshstreamingmoderam - Mesh streaming mode.

int getMeshStreamingModeRAM ( ) #

Returns the current streaming mode for loading the mesh to memory (RAM).

Return value

Mesh streaming mode.

void setMeshStreamingModeVRAM ( int meshstreamingmodevram ) #

Sets the streaming mode for loading the base mesh used for the object to video memory (VRAM).

Arguments

  • int meshstreamingmodevram - Mesh streaming mode.

int getMeshStreamingModeVRAM ( ) #

Returns the current streaming mode for loading the mesh to video memory (VRAM).

Return value

Mesh streaming mode.
Last update: 2023-07-18
Build: ()