G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
UStaticMesh Class Reference

A StaticMesh is a piece of geometry that consists of a static set of polygons. Static Meshes can be translated, rotated, and scaled, but they cannot have their vertices animated in any way. As such, they are more efficient to render than other types of geometry such as USkeletalMesh, and they are often the basic building block of levels created in the engine. More...

Public Member Functions

Functions
void SetStaticMaterials (TArray< FStaticMaterial > InStaticMaterials)
const TArray< FStaticMaterial > & GetStaticMaterials () const
void SetbHasNavigationData (bool Value)
 If true, mesh will have NavCollision property with additional data for navmesh generation and usage. Set to false for distant meshes (always outside navigation bounds) to save memory on collision data.
void SetbSupportUniformlyDistributedSampling (bool Value)
 Mesh supports uniformly distributed sampling in constant time. Memory cost is 8 bytes per triangle. Example usage is uniform spawning of particles.
void SetbSupportPhysicalMaterialMasks (bool Value)
 If true, complex collision data will store UVs and face remap table for use when performing PhysicalMaterialMask lookups in cooked builds. Note the increased memory cost for this functionality.
void SetbUseLegacyTangentScaling (bool Value)
void SetbSupportRayTracing (bool Value)
 If true, a ray tracing acceleration structure will be built for this mesh and it may be used in ray tracing effects.
void SetbAllowCPUAccess (bool Value)
 If true, will keep geometry data CPU-accessible in cooked builds, rather than uploading to GPU memory and releasing it from CPU memory. This is required if you wish to access StaticMesh geometry data on the CPU at runtime in cooked builds (e.g. to convert StaticMesh to ProceduralMeshComponent).
void SetbSupportGpuUniformlyDistributedSampling (bool Value)
 If true, a GPU buffer containing required data for uniform mesh surface sampling will be created at load time. It is created from the cpu data so bSupportUniformlyDistributedSampling is also required to be true.
void SetbGenerateMeshDistanceField (bool Value)
 Whether to generate a distance field for this mesh, which can be used by DistanceField Indirect Shadows. This is ignored if the project's 'Generate Mesh Distance Fields' setting is enabled.
Public Member Functions inherited from UStreamableRenderAsset
void SetForceMipLevelsToBeResident (float32 Seconds, int CinematicLODGroupMask=0)
 Tells the streaming system that it should force all mip-levels to be resident for a number of seconds.
void SetNeverStream (bool Value)
bool GetbGlobalForceMipLevelsToBeResident () const
 Global and serialized version of ForceMiplevelsToBeResident.
void SetbGlobalForceMipLevelsToBeResident (bool Value)
 Global and serialized version of ForceMiplevelsToBeResident.
bool GetNeverStream () const
Public Member Functions inherited from UObject
bool MarkPackageDirty () const
void RemoveFromRoot ()
bool GetIsRooted () const
bool IsTransient () const
bool Modify (bool bAlwaysMarkDirty=true)
void SetTransactional (bool bTransactional)
bool IsSupportedForNetworking () const
UClass GetClass () const
UObject GetOuter () const
UObject GetTypedOuter (TSubclassOf< UObject > Target) const
 Traverses the outer chain searching for the next object of a certain type.
UPackage GetOutermost () const
UPackage GetPackage () const
void AddToRoot ()
UWorld GetWorld () const
FName GetName () const
FString GetFullName (const UObject StopOuter=nullptr) const
FString GetPathName (const UObject StopOuter=nullptr) const
bool IsA (const UClass Class) const
 Returns true if this object is of the specified type, or a child of that type.
void SaveConfig ()
void LoadConfig ()
void ReloadConfig ()
void CopyScriptPropertiesFrom (const UObject OtherObject)
void opCast (?&Address) const
FString ToString () const

Static Public Member Functions

Static Functions
static UClass StaticClass ()
Static Public Member Functions inherited from UStreamableRenderAsset
static UClass StaticClass ()
Static Public Member Functions inherited from UObject
static UClass StaticClass ()

Public Attributes

Collision
bool bCustomizedCollision
 If the user has modified collision in any way or has custom collision imported. Used for determining if to auto generate collision on import.
UStaticMesh ComplexCollisionMesh
ImportSettings
UAssetImportData AssetImportData
 Importing data and options used for this mesh.
LodSettings
FName LODGroup
 The LOD group to which this mesh belongs.
NaniteSettings
FMeshNaniteSettings NaniteSettings
 Settings related to building Nanite data.
Navigation
UNavCollisionBase NavCollision
Public Attributes inherited from UStreamableRenderAsset
bool NeverStream
bool bGlobalForceMipLevelsToBeResident
 Global and serialized version of ForceMiplevelsToBeResident.
int NumCinematicMipLevels
 Number of mip-levels to use for cinematic quality.
Public Attributes inherited from UObject
const UClass Class
const UObject Outer
const UPackage Outermost
const UPackage Package
const UWorld World
const FName Name
const bool IsRooted

StaticMesh

int LODForCollision
 Specifies which mesh LOD to use for complex (per-poly) collision. Sometimes it can be desirable to use a lower poly representation for collision to reduce memory usage, improve performance and behaviour. Collision representation does not change based on distance to camera.
int LightMapCoordinateIndex
 The light map coordinate index.
UBodySetup BodySetup
float32 DistanceFieldSelfShadowBias
 Useful for reducing self shadowing from distance field methods when using world position offset to animate the mesh's vertices.
UThumbnailInfo ThumbnailInfo
 Information for thumbnail rendering.
FVector NegativeBoundsExtension
TArray< TObjectPtr< UAssetUserData > > AssetUserData
 Array of user data stored with the asset.
int LightMapResolution
 The light map resolution.
FVector PositiveBoundsExtension
const FBox BoundingBox
 Returns the bounding box, in local space including bounds extension(s), of the StaticMesh asset.
const FBoxSphereBounds Bounds
 Returns the number of bounds of the mesh.
const int NumLods
 Returns the number of LODs used by the mesh.
TArray< FStaticMaterial > StaticMaterials
UStaticMeshDescription GetStaticMeshDescription (int LODIndex)
 Return a new StaticMeshDescription referencing the MeshDescription of the given LOD.
void AddSocket (UStaticMeshSocket Socket)
 Add a socket object in this StaticMesh.
void BuildFromStaticMeshDescriptions (TArray< UStaticMeshDescription > StaticMeshDescriptions, bool bBuildSimpleCollision=false, bool bFastBuild=true)
 Builds static mesh LODs from the array of StaticMeshDescriptions passed in.
UStaticMeshSocket FindSocket (FName InSocketName) const
 Find a socket object in this StaticMesh by name. Entering NAME_None will return NULL. If there are multiple sockets with the same name, will return the first one.
FBox GetBoundingBox () const
 Returns the bounding box, in local space including bounds extension(s), of the StaticMesh asset.
FBoxSphereBounds GetBounds () const
 Returns the number of bounds of the mesh.
UMaterialInterface GetMaterial (int MaterialIndex) const
 Gets a Material given a Material Index and an LOD number.
int GetMaterialIndex (FName MaterialSlotName) const
 Gets a Material index given a slot name.
int GetMinimumLODForPlatform (FName PlatformName) const
void GetMinimumLODForPlatforms (TMap< FName, int > &PlatformMinimumLODs) const
int GetMinimumLODForQualityLevel (FName QualityLevel) const
void GetMinimumLODForQualityLevels (TMap< FName, int > &QualityLevelMinimumLODs) const
void GetMinLODForQualityLevels (TMap< EPerQualityLevels, int > &QualityLevelMinimumLODs, int &Default) const
int GetNumLods () const
 Returns the number of LODs used by the mesh.
int GetNumSections (int InLOD) const
 Returns number of Sections that this StaticMesh has, in the supplied LOD (LOD 0 is the highest).
int GetNumTriangles (int LODIndex) const
 Returns the number of triangles in the render data for the specified LOD.
TArray< UStaticMeshSocket > GetSocketsByTag (FString InSocketTag) const
 Returns a list of sockets with the provided tag.
void SetMaterial (int MaterialIndex, UMaterialInterface NewMaterial)
 Sets a Material given a Material Index.
FName AddMaterial (UMaterialInterface Material)
 Adds a new material and return its slot name.
bool IsLODScreenSizeAutoComputed () const
void RemoveSocket (UStaticMeshSocket Socket)
 Remove a socket object in this StaticMesh by providing it's pointer. Use FindSocket() if needed.
void SetMinimumLODForPlatform (FName PlatformName, int InMinLOD)
void SetMinimumLODForPlatforms (TMap< FName, int > PlatformMinimumLODs)
void SetMinLODForQualityLevels (TMap< EPerQualityLevels, int > QualityLevelMinimumLODs, int Default=- 1)
 Allow to override min lod quality levels on a staticMesh and it Default value (-1 value for Default dont override its value).
void SetNumSourceModels (int Num)
static UStaticMeshDescription CreateStaticMeshDescription (UObject Outer=nullptr)
 Create an empty StaticMeshDescription object, to describe a static mesh at runtime.

Detailed Description

A StaticMesh is a piece of geometry that consists of a static set of polygons. Static Meshes can be translated, rotated, and scaled, but they cannot have their vertices animated in any way. As such, they are more efficient to render than other types of geometry such as USkeletalMesh, and they are often the basic building block of levels created in the engine.

@see https://docs.unrealengine.com/latest/INT/Engine/Content/Types/StaticMeshes/ @see AStaticMeshActor, UStaticMeshComponent

Member Function Documentation

◆ AddMaterial()

FName AddMaterial ( UMaterialInterface Material)

Adds a new material and return its slot name.

◆ AddSocket()

void AddSocket ( UStaticMeshSocket Socket)

Add a socket object in this StaticMesh.

◆ BuildFromStaticMeshDescriptions()

void BuildFromStaticMeshDescriptions ( TArray< UStaticMeshDescription > StaticMeshDescriptions,
bool bBuildSimpleCollision = false,
bool bFastBuild = true )

Builds static mesh LODs from the array of StaticMeshDescriptions passed in.

◆ CreateStaticMeshDescription()

UStaticMeshDescription CreateStaticMeshDescription ( UObject Outer = nullptr)
static

Create an empty StaticMeshDescription object, to describe a static mesh at runtime.

◆ FindSocket()

UStaticMeshSocket FindSocket ( FName InSocketName) const

Find a socket object in this StaticMesh by name. Entering NAME_None will return NULL. If there are multiple sockets with the same name, will return the first one.

◆ GetBoundingBox()

FBox GetBoundingBox ( ) const

Returns the bounding box, in local space including bounds extension(s), of the StaticMesh asset.

◆ GetBounds()

FBoxSphereBounds GetBounds ( ) const

Returns the number of bounds of the mesh.

Returns
The bounding box represented as box origin with extents and also a sphere that encapsulates that box

◆ GetMaterial()

UMaterialInterface GetMaterial ( int MaterialIndex) const

Gets a Material given a Material Index and an LOD number.

Returns
Requested material

◆ GetMaterialIndex()

int GetMaterialIndex ( FName MaterialSlotName) const

Gets a Material index given a slot name.

Returns
Requested material

◆ GetMinimumLODForPlatform()

int GetMinimumLODForPlatform ( FName PlatformName) const

◆ GetMinimumLODForPlatforms()

void GetMinimumLODForPlatforms ( TMap< FName, int > & PlatformMinimumLODs) const

◆ GetMinimumLODForQualityLevel()

int GetMinimumLODForQualityLevel ( FName QualityLevel) const

◆ GetMinimumLODForQualityLevels()

void GetMinimumLODForQualityLevels ( TMap< FName, int > & QualityLevelMinimumLODs) const

◆ GetMinLODForQualityLevels()

void GetMinLODForQualityLevels ( TMap< EPerQualityLevels, int > & QualityLevelMinimumLODs,
int & Default ) const

◆ GetNumLods()

int GetNumLods ( ) const

Returns the number of LODs used by the mesh.

◆ GetNumSections()

int GetNumSections ( int InLOD) const

Returns number of Sections that this StaticMesh has, in the supplied LOD (LOD 0 is the highest).

◆ GetNumTriangles()

int GetNumTriangles ( int LODIndex) const

Returns the number of triangles in the render data for the specified LOD.

◆ GetSocketsByTag()

TArray< UStaticMeshSocket > GetSocketsByTag ( FString InSocketTag) const

Returns a list of sockets with the provided tag.

◆ GetStaticMaterials()

const TArray< FStaticMaterial > & GetStaticMaterials ( ) const

◆ GetStaticMeshDescription()

UStaticMeshDescription GetStaticMeshDescription ( int LODIndex)

Return a new StaticMeshDescription referencing the MeshDescription of the given LOD.

◆ IsLODScreenSizeAutoComputed()

bool IsLODScreenSizeAutoComputed ( ) const

◆ RemoveSocket()

void RemoveSocket ( UStaticMeshSocket Socket)

Remove a socket object in this StaticMesh by providing it's pointer. Use FindSocket() if needed.

◆ SetbAllowCPUAccess()

void SetbAllowCPUAccess ( bool Value)

If true, will keep geometry data CPU-accessible in cooked builds, rather than uploading to GPU memory and releasing it from CPU memory. This is required if you wish to access StaticMesh geometry data on the CPU at runtime in cooked builds (e.g. to convert StaticMesh to ProceduralMeshComponent).

◆ SetbGenerateMeshDistanceField()

void SetbGenerateMeshDistanceField ( bool Value)

Whether to generate a distance field for this mesh, which can be used by DistanceField Indirect Shadows. This is ignored if the project's 'Generate Mesh Distance Fields' setting is enabled.

◆ SetbHasNavigationData()

void SetbHasNavigationData ( bool Value)

If true, mesh will have NavCollision property with additional data for navmesh generation and usage. Set to false for distant meshes (always outside navigation bounds) to save memory on collision data.

◆ SetbSupportGpuUniformlyDistributedSampling()

void SetbSupportGpuUniformlyDistributedSampling ( bool Value)

If true, a GPU buffer containing required data for uniform mesh surface sampling will be created at load time. It is created from the cpu data so bSupportUniformlyDistributedSampling is also required to be true.

◆ SetbSupportPhysicalMaterialMasks()

void SetbSupportPhysicalMaterialMasks ( bool Value)

If true, complex collision data will store UVs and face remap table for use when performing PhysicalMaterialMask lookups in cooked builds. Note the increased memory cost for this functionality.

◆ SetbSupportRayTracing()

void SetbSupportRayTracing ( bool Value)

If true, a ray tracing acceleration structure will be built for this mesh and it may be used in ray tracing effects.

◆ SetbSupportUniformlyDistributedSampling()

void SetbSupportUniformlyDistributedSampling ( bool Value)

Mesh supports uniformly distributed sampling in constant time. Memory cost is 8 bytes per triangle. Example usage is uniform spawning of particles.

◆ SetbUseLegacyTangentScaling()

void SetbUseLegacyTangentScaling ( bool Value)

◆ SetMaterial()

void SetMaterial ( int MaterialIndex,
UMaterialInterface NewMaterial )

Sets a Material given a Material Index.

◆ SetMinimumLODForPlatform()

void SetMinimumLODForPlatform ( FName PlatformName,
int InMinLOD )

◆ SetMinimumLODForPlatforms()

void SetMinimumLODForPlatforms ( TMap< FName, int > PlatformMinimumLODs)

◆ SetMinLODForQualityLevels()

void SetMinLODForQualityLevels ( TMap< EPerQualityLevels, int > QualityLevelMinimumLODs,
int Default = - 1 )

Allow to override min lod quality levels on a staticMesh and it Default value (-1 value for Default dont override its value).

◆ SetNumSourceModels()

void SetNumSourceModels ( int Num)

◆ SetStaticMaterials()

void SetStaticMaterials ( TArray< FStaticMaterial > InStaticMaterials)

◆ StaticClass()

UClass StaticClass ( )
static

Member Data Documentation

◆ AssetImportData

UAssetImportData AssetImportData

Importing data and options used for this mesh.

◆ AssetUserData

TArray<TObjectPtr<UAssetUserData> > AssetUserData

Array of user data stored with the asset.

◆ bCustomizedCollision

bool bCustomizedCollision

If the user has modified collision in any way or has custom collision imported. Used for determining if to auto generate collision on import.

◆ BodySetup

UBodySetup BodySetup

◆ BoundingBox

const FBox BoundingBox

Returns the bounding box, in local space including bounds extension(s), of the StaticMesh asset.

◆ Bounds

const FBoxSphereBounds Bounds

Returns the number of bounds of the mesh.

◆ ComplexCollisionMesh

UStaticMesh ComplexCollisionMesh

◆ DistanceFieldSelfShadowBias

float32 DistanceFieldSelfShadowBias

Useful for reducing self shadowing from distance field methods when using world position offset to animate the mesh's vertices.

◆ LightMapCoordinateIndex

int LightMapCoordinateIndex

The light map coordinate index.

◆ LightMapResolution

int LightMapResolution

The light map resolution.

◆ LODForCollision

int LODForCollision

Specifies which mesh LOD to use for complex (per-poly) collision. Sometimes it can be desirable to use a lower poly representation for collision to reduce memory usage, improve performance and behaviour. Collision representation does not change based on distance to camera.

◆ LODGroup

FName LODGroup

The LOD group to which this mesh belongs.

◆ NaniteSettings

FMeshNaniteSettings NaniteSettings

Settings related to building Nanite data.

◆ NavCollision

UNavCollisionBase NavCollision

◆ NegativeBoundsExtension

FVector NegativeBoundsExtension

◆ NumLods

const int NumLods

Returns the number of LODs used by the mesh.

◆ PositiveBoundsExtension

FVector PositiveBoundsExtension

◆ StaticMaterials

TArray<FStaticMaterial> StaticMaterials

◆ ThumbnailInfo

UThumbnailInfo ThumbnailInfo

Information for thumbnail rendering.