A StaticMesh is a piece of geometry that consists of a static set of polygons. 更多...
#include <StaticMesh.h>
继承自 UStreamableRenderAsset, IInterface_CollisionDataProvider , 以及 IInterface_AssetUserData .
类 | |
| struct | FBuildMeshDescriptionsParams |
| Structure that defines parameters passed into the build mesh description function 更多... | |
Public 成员函数 | |
| ENGINE_API FName | AddMaterial (UMaterialInterface *Material) |
| Adds a new material and return its slot name | |
| ENGINE_API void | AddSocket (UStaticMeshSocket *Socket) |
| Add a socket object in this StaticMesh. | |
| virtual ENGINE_API void | BeginDestroy () override |
| Called before destroying the object. 更多... | |
| ENGINE_API void | Build (bool bInSilent=false, TArray< FText > *OutErrors=nullptr) |
| Rebuilds renderable data for this static mesh. 更多... | |
| void | BuildFromMeshDescription (const FMeshDescription &MeshDescription, FStaticMeshLODResources &LODResources) |
| Builds a LOD resource from a MeshDescription | |
| ENGINE_API bool | BuildFromMeshDescriptions (const TArray< const FMeshDescription * > &MeshDescriptions, const FBuildMeshDescriptionsParams &Params=FBuildMeshDescriptionsParams()) |
| Builds static mesh render buffers from a list of MeshDescriptions, one per LOD. | |
| ENGINE_API void | BuildFromStaticMeshDescriptions (const TArray< UStaticMeshDescription * > &StaticMeshDescriptions, bool bBuildSimpleCollision=false) |
| Builds static mesh LODs from the array of StaticMeshDescriptions passed in | |
| ENGINE_API void | CalculateExtendedBounds () |
| Calculates the extended bounds | |
| virtual ENGINE_API bool | CanBeClusterRoot () const override |
| Called after load to determine if the object can be a cluster root 更多... | |
| ENGINE_API void | CreateBodySetup () |
| Create BodySetup for this staticmesh if it doesn't have one | |
| ENGINE_API void | CreateNavCollision (const bool bIsUpdate=false) |
| Calculates navigation collision for caching | |
| ENGINE_API void | EnforceLightmapRestrictions (bool bUseRenderData=true) |
| Make sure the Lightmap UV point on a valid UVChannel | |
| ENGINE_API class UStaticMeshSocket * | FindSocket (FName InSocketName) const |
| Find a socket object in this StaticMesh by name. 更多... | |
| virtual ENGINE_API void | GetAssetRegistryTags (TArray< FAssetRegistryTag > &OutTags) const override |
| Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects 更多... | |
| ENGINE_API FBox | GetBoundingBox () const |
| Returns the bounding box, in local space including bounds extension(s), of the StaticMesh asset | |
| ENGINE_API FBoxSphereBounds | GetBounds () const |
| Returns the number of bounds of the mesh. 更多... | |
| virtual ENGINE_API FString | GetDesc () override |
| Return a one line description of an object for viewing in the thumbnail view of the generic browser | |
| ENGINE_API const FStaticMeshLODResources & | GetLODForExport (int32 LODIndex) const |
| Returns the render data to use for exporting the specified LOD. 更多... | |
| ENGINE_API UMaterialInterface * | GetMaterial (int32 MaterialIndex) const |
| Gets a Material given a Material Index and an LOD number 更多... | |
| ENGINE_API FBox | GetMaterialBox (int32 MaterialIndex, const FTransform &Transform) const |
| Returns the material bounding box. 更多... | |
| ENGINE_API int32 | GetMaterialIndex (FName MaterialSlotName) const |
| Gets a Material index given a slot name 更多... | |
| ENGINE_API int32 | GetNumLODs () const |
| Returns the number of LODs used by the mesh. | |
| ENGINE_API int32 | GetNumSections (int32 InLOD) const |
| Returns number of Sections that this StaticMesh has, in the supplied LOD (LOD 0 is the highest) | |
| int32 | GetNumSectionsWithCollision () const |
| Return the number of sections of the StaticMesh with collision enabled | |
| ENGINE_API int32 | GetNumUVChannels (int32 LODIndex) |
| Returns the number of UV channels for the given LOD of a StaticMesh. 更多... | |
| ENGINE_API int32 | GetNumVertices (int32 LODIndex) const |
| Returns the number of vertices for the specified LOD. | |
| virtual ENGINE_API void | GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize) override |
| Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific). 更多... | |
| ENGINE_API const FMeshUVChannelInfo * | GetUVChannelData (int32 MaterialIndex) const |
| Returns the UV channel data for a given material index. 更多... | |
| ENGINE_API void | GetVertexColorData (TMap< FVector, FColor > &VertexColorData) |
| Returns vertex color data by position. 更多... | |
| ENGINE_API bool | HasValidRenderData (bool bCheckLODForVerts=true, int32 LODIndex=INDEX_NONE) const |
| Returns true if the mesh has data that can be rendered. | |
| virtual ENGINE_API void | InitResources () |
| Initialize the static mesh's render resources. | |
| virtual bool | IsPostLoadThreadSafe () const override |
| Called during async load to determine if PostLoad can be called on the loading thread. 更多... | |
| virtual ENGINE_API bool | IsReadyForFinishDestroy () override |
| Called to check if the object is ready for FinishDestroy. 更多... | |
| ENGINE_API void | MarkAsNotHavingNavigationData () |
| Configures this SM as bHasNavigationData = false and clears stored NavCollision | |
| virtual ENGINE_API void | PostInitProperties () override |
| Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多... | |
| virtual ENGINE_API void | PostLoad () override |
| Do any object-specific cleanup required immediately after loading an object. 更多... | |
| virtual ENGINE_API void | ReleaseResources () |
| Releases the static mesh's render resources. | |
| ENGINE_API void | RemoveSocket (UStaticMeshSocket *Socket) |
| Remove a socket object in this StaticMesh by providing it's pointer. 更多... | |
| ENGINE_API void | RemoveVertexColors () |
| Removes all vertex colors from this mesh and rebuilds it (Editor only | |
| virtual ENGINE_API void | Serialize (FArchive &Ar) override |
| Handles reading, writing, and reference collecting using FArchive. 更多... | |
| ENGINE_API void | SetVertexColorData (const TMap< FVector, FColor > &VertexColorData) |
| Sets vertex color data by position. 更多... | |
| ENGINE_API void | UpdateUVChannelData (bool bRebuildAll) |
| Update missing material UV channel data used for texture streaming. 更多... | |
| ENGINE_API | UStaticMesh (const FObjectInitializer &ObjectInitializer=FObjectInitializer::Get()) |
| Default constructor | |
静态 Public 成员函数 | |
| static ENGINE_API void | BatchBuild (const TArray< UStaticMesh * > &InStaticMeshes, bool bInSilent=false, TFunction< bool(UStaticMesh *)> InProgressCallback=nullptr, TArray< FText > *OutErrors=nullptr) |
| Rebuilds renderable data for a batch of static meshes. 更多... | |
| static ENGINE_API void | CancelAllPendingStreamingActions () |
| Cancels any pending static mesh streaming actions if possible. 更多... | |
| static ENGINE_API void | CheckLightMapUVs (UStaticMesh *InStaticMesh, TArray< FString > &InOutAssetsWithMissingUVSets, TArray< FString > &InOutAssetsWithBadUVSets, TArray< FString > &InOutAssetsWithValidUVSets, bool bInVerbose=true) |
| Static: Processes the specified static mesh for light map UV problems 更多... | |
| static ENGINE_API UStaticMeshDescription * | CreateStaticMeshDescription (UObject *Outer=nullptr) |
| Create an empty StaticMeshDescription object, to describe a static mesh at runtime | |
| static ENGINE_API void | RegisterMeshAttributes (FMeshDescription &MeshDescription) |
| Registers the mesh attributes required by the mesh description for a static mesh. | |
Public 属性 | |
| uint8 | bAllowCPUAccess:1 |
| If true, will keep geometry data CPU-accessible in cooked builds, rather than uploading to GPU memory and releasing it from CPU memory. 更多... | |
| uint8 | bSupportGpuUniformlyDistributedSampling: 1 |
| If true, a GPU buffer containing required data for uniform mesh surface sampling will be created at load time. 更多... | |
| class UObject * | EditableMesh |
| The editable mesh representation of this static mesh | |
| FBoxSphereBounds | ExtendedBounds |
| Original mesh bounds extended with Positive/NegativeBoundsExtension | |
| FGuid | LightingGuid |
| Unique ID for tracking/caching this mesh during distributed lighting | |
| UNavCollisionBase * | NavCollision |
| Pre-build navigation collision | |
| FVector | NegativeBoundsExtension |
| Bound extension values in the negative direction of XYZ, positive value increases bound size | |
| FVector | PositiveBoundsExtension |
| Bound extension values in the positive direction of XYZ, positive value increases bound size | |
| FRenderCommandFence | ReleaseResourcesFence |
| A fence which is used to keep track of the rendering thread releasing the static mesh resources. | |
| TArray< class UStaticMeshSocket * > | Sockets |
| Array of named socket locations, set up in editor and used as a shortcut instead of specifying everything explicitly to AttachComponent in the StaticMeshComponent. | |
| TSharedPtr< class FSpeedTreeWind > | SpeedTreeWind |
| Data that is only available if this static mesh is an imported SpeedTree | |
Protected 属性 | |
| TArray< UAssetUserData * > | AssetUserData |
| Array of user data stored with the asset | |
| uint8 | bRenderingResourcesInitialized:1 |
| Tracks whether InitResources has been called, and rendering resources are initialized. | |
| int32 | ElementToIgnoreForTexFactor |
| Index of an element to ignore while gathering streaming texture factors. 更多... | |
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.
|
static |
Rebuilds renderable data for a batch of static meshes.
| InStaticMeshes | The list of all static meshes to build. | |
| bInSilent | If true will not popup a progress dialog. | |
| InProgressCallback | If provided, will be used to abort task and report progress to higher level functions (should return true to continue, false to abort). | |
| [out] | OutErrors | If provided, will contain the errors that occurred during this process. |
|
overridevirtual |
Called before destroying the object.
This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process.
重载 UObject .
| ENGINE_API void UStaticMesh::Build | ( | bool | bInSilent = false, |
| TArray< FText > * | OutErrors = nullptr |
||
| ) |
Rebuilds renderable data for this static mesh.
| bInSilent | If true will not popup a progress dialog. | |
| [out] | OutErrors | If provided, will contain the errors that occurred during this process. |
|
overridevirtual |
Called after load to determine if the object can be a cluster root
重载 UObjectBaseUtility .
|
static |
Cancels any pending static mesh streaming actions if possible.
Returns when no more async loading requests are in flight.
|
static |
Static: Processes the specified static mesh for light map UV problems
| InStaticMesh | Static mesh to process |
| InOutAssetsWithMissingUVSets | Array of assets that we found with missing UV sets |
| InOutAssetsWithBadUVSets | Array of assets that we found with bad UV sets |
| InOutAssetsWithValidUVSets | Array of assets that we found with valid UV sets |
| bInVerbose | If true, log the items as they are found |
| ENGINE_API class UStaticMeshSocket * UStaticMesh::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.
|
overridevirtual |
Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects
| OutTags | A list of key-value pairs associated with this object and their types |
重载 UObject .
| ENGINE_API FBoxSphereBounds UStaticMesh::GetBounds | ( | ) | const |
Returns the number of bounds of the mesh.
| ENGINE_API const FStaticMeshLODResources & UStaticMesh::GetLODForExport | ( | int32 | LODIndex | ) | const |
Returns the render data to use for exporting the specified LOD.
This method should always be called when exporting a static mesh.
| ENGINE_API UMaterialInterface * UStaticMesh::GetMaterial | ( | int32 | MaterialIndex | ) | const |
Gets a Material given a Material Index and an LOD number
| ENGINE_API FBox UStaticMesh::GetMaterialBox | ( | int32 | MaterialIndex, |
| const FTransform & | Transform | ||
| ) | const |
Returns the material bounding box.
Computed from all lod-section using the material index.
| MaterialIndex | Material Index to look at |
| TransformMatrix | Matrix to be applied to the position before computing the bounds |
| ENGINE_API int32 UStaticMesh::GetMaterialIndex | ( | FName | MaterialSlotName | ) | const |
Gets a Material index given a slot name
| ENGINE_API int32 UStaticMesh::GetNumUVChannels | ( | int32 | LODIndex | ) |
Returns the number of UV channels for the given LOD of a StaticMesh.
| LODIndex | Index of the StaticMesh LOD. |
|
overridevirtual |
Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific).
| CumulativeResourceSize | Struct used to count up the cumulative size of the resource as to be displayed to artists/LDs in the Editor. |
重载 UObject .
| ENGINE_API const FMeshUVChannelInfo * UStaticMesh::GetUVChannelData | ( | int32 | MaterialIndex | ) | const |
Returns the UV channel data for a given material index.
Used by the texture streamer. This data applies to all lod-section using the same material.
| MaterialIndex | the material index for which to get the data for. |
Returns vertex color data by position.
For matching to reimported meshes that may have changed or copying vertex paint data from mesh to mesh.
| VertexColorData | (out)A map of vertex position data and its color. The method fills this map. |
|
overridevirtual |
Called during async load to determine if PostLoad can be called on the loading thread.
重载 UObject .
|
overridevirtual |
Called to check if the object is ready for FinishDestroy.
This is called after BeginDestroy to check the completion of the potentially asynchronous object cleanup.
重载 UObject .
|
overridevirtual |
Called after the C++ constructor and after the properties have been initialized, including those loaded from config.
This is called before any serialization or other setup has happened.
重载 UObject .
|
overridevirtual |
Do any object-specific cleanup required immediately after loading an object.
This is not called for newly-created objects, and by default will always execute on the game thread.
重载 UObject .
| ENGINE_API void UStaticMesh::RemoveSocket | ( | UStaticMeshSocket * | Socket | ) |
Remove a socket object in this StaticMesh by providing it's pointer.
Use FindSocket() if needed.
|
overridevirtual |
Sets vertex color data by position.
Map of vertex color data by position is matched to the vertex position in the mesh and nearest matching vertex color is used.
| VertexColorData | A map of vertex position data and color. |
| ENGINE_API void UStaticMesh::UpdateUVChannelData | ( | bool | bRebuildAll | ) |
Update missing material UV channel data used for texture streaming.
| bRebuildAll | If true, rebuild everything and not only missing data. |
| uint8 UStaticMesh::bAllowCPUAccess |
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)
| uint8 UStaticMesh::bSupportGpuUniformlyDistributedSampling |
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.
|
protected |
Index of an element to ignore while gathering streaming texture factors.
This is useful to disregard automatically generated vertex data which breaks texture factor heuristics.