You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Geometry collection : make sure Resttransform are in sync with RestCollection to avoid scrambled assets in previews
#rb trivial #preflight none [CL 24253436 by cedric caillaud in ue5-main branch]
This commit is contained in:
@@ -2726,6 +2726,13 @@ void UGeometryCollectionComponent::ResetDynamicCollection()
|
||||
SetRenderStateDirty();
|
||||
}
|
||||
|
||||
// make sure we have the RestTransforms up to date, other wise, otherwise there may be case where they do not match the Restcollection ones
|
||||
// can happen if the RestCollection asset has been changed without the component knowing about it
|
||||
if (RestCollection && RestCollection->GetGeometryCollection())
|
||||
{
|
||||
RestTransforms = RestCollection->GetGeometryCollection()->Transform.GetConstArray();
|
||||
}
|
||||
|
||||
if (RestTransforms.Num() > 0)
|
||||
{
|
||||
SetInitialTransforms(RestTransforms);
|
||||
@@ -3276,12 +3283,7 @@ void UGeometryCollectionComponent::SetRestCollection(const UGeometryCollection*
|
||||
{
|
||||
RestCollection = RestCollectionIn;
|
||||
|
||||
const int32 NumTransforms = RestCollection->GetGeometryCollection()->NumElements(FGeometryCollection::TransformGroup);
|
||||
RestTransforms.SetNum(NumTransforms);
|
||||
for (int32 Idx = 0; Idx < NumTransforms; ++Idx)
|
||||
{
|
||||
RestTransforms[Idx] = RestCollection->GetGeometryCollection()->Transform[Idx];
|
||||
}
|
||||
RestTransforms = RestCollection->GetGeometryCollection()->Transform.GetConstArray();
|
||||
|
||||
CalculateGlobalMatrices();
|
||||
CalculateLocalBounds();
|
||||
|
||||
Reference in New Issue
Block a user