Refresh cached transforms before saving. (#1858)

If the prefab template saves default values for a cached transform, but *shouldn't* have default values, it will get patch application errors at runtime due to missing cached transform fields.

Signed-off-by: mbalfour <mbalfour@amazon.com>
This commit is contained in:
Mike Balfour
2021-07-06 14:17:21 -05:00
committed by GitHub
parent 5fdb33b1d7
commit 71c6b3e506
2 changed files with 14 additions and 0 deletions
@@ -72,6 +72,7 @@ namespace AZ
bool ConvertSliceInstance(
AZ::SliceComponent::SliceInstance& instance, AZ::Data::Asset<AZ::SliceAsset>& sliceAsset,
AzToolsFramework::Prefab::TemplateReference nestedTemplate, AzToolsFramework::Prefab::Instance* topLevelInstance);
void UpdateCachedTransform(const AZ::Entity& entity);
void SetParentEntity(const AZ::Entity& entity, const AZ::EntityId& parentId, bool onlySetIfInvalid);
void PrintPrefab(AzToolsFramework::Prefab::TemplateId templateId);
bool SavePrefab(AZ::IO::PathView outputPath, AzToolsFramework::Prefab::TemplateId templateId);