You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Geometry collection assets created from one or more static meshes will have Nanite automatically enabled now, as long as at least one of the input meshes had Nanite enabled originally.
#rb trivial #fyi brian.karis, rune.stubbe #jira UE-104791 [CL 15028299 by graham wihlidal in ue5-main branch]
This commit is contained in:
@@ -177,6 +177,12 @@ AGeometryCollectionActor* UFractureToolGenerateAsset::ConvertStaticMeshToGeometr
|
||||
if (StaticMeshComponent != nullptr)
|
||||
{
|
||||
UStaticMesh* ComponentStaticMesh = StaticMeshComponent->GetStaticMesh();
|
||||
if (ComponentStaticMesh != nullptr)
|
||||
{
|
||||
// If any of the static meshes have Nanite enabled, also enable on the new geometry collection asset for convenience.
|
||||
FracturedGeometryCollection->EnableNanite |= ComponentStaticMesh->NaniteSettings.bEnabled;
|
||||
}
|
||||
|
||||
FTransform ComponentTransform(StaticMeshComponent->GetComponentTransform());
|
||||
ComponentTransform.SetTranslation((ComponentTransform.GetTranslation() - ActorTransform.GetTranslation()) + ActorOffset);
|
||||
|
||||
@@ -191,8 +197,15 @@ AGeometryCollectionActor* UFractureToolGenerateAsset::ConvertStaticMeshToGeometr
|
||||
|
||||
FracturedGeometryCollection->InitializeMaterials();
|
||||
}
|
||||
|
||||
AddSingleRootNodeIfRequired(FracturedGeometryCollection);
|
||||
|
||||
if (FracturedGeometryCollection->EnableNanite)
|
||||
{
|
||||
FracturedGeometryCollection->InvalidateCollection();
|
||||
FracturedGeometryCollection->EnsureDataIsCooked(false /* init resources */);
|
||||
}
|
||||
|
||||
return NewActor;
|
||||
}
|
||||
|
||||
|
||||
@@ -736,13 +736,13 @@ bool UGeometryCollection::Modify(bool bAlwaysMarkDirty /*= true*/)
|
||||
return bSuperResult;
|
||||
}
|
||||
|
||||
void UGeometryCollection::EnsureDataIsCooked()
|
||||
void UGeometryCollection::EnsureDataIsCooked(bool bInitResources)
|
||||
{
|
||||
if (StateGuid != LastBuiltGuid)
|
||||
{
|
||||
CreateSimulationDataImp(/*bCopyFromDDC=*/ true);
|
||||
|
||||
if (FApp::CanEverRender())
|
||||
if (FApp::CanEverRender() && bInitResources)
|
||||
{
|
||||
NaniteData->InitResources(this);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
void Serialize(FArchive& Ar);
|
||||
|
||||
#if WITH_EDITOR
|
||||
void EnsureDataIsCooked();
|
||||
void EnsureDataIsCooked(bool bInitResources = true);
|
||||
#endif
|
||||
|
||||
/** Accessors for internal geometry collection */
|
||||
|
||||
Reference in New Issue
Block a user