diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index dd1fdec74d..07be2a6644 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -298,7 +298,7 @@ namespace AzToolsFramework Prefab::PrefabDom serializedInstance; if (Prefab::PrefabDomUtils::StoreInstanceInPrefabDom(addedInstance, serializedInstance)) { - m_prefabSystemComponent->UpdatePrefabTemplate(addedInstance.GetTemplateId(), serializedInstance, false); + m_prefabSystemComponent->UpdatePrefabTemplate(addedInstance.GetTemplateId(), serializedInstance); } return addedInstance; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp index 53652933a4..d89a388e91 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp @@ -159,7 +159,7 @@ namespace AzToolsFramework } } - void PrefabSystemComponent::UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom, bool shouldPropagateTemplateChanges) + void PrefabSystemComponent::UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom) { auto templateToUpdate = FindTemplate(templateId); if (templateToUpdate) @@ -169,10 +169,7 @@ namespace AzToolsFramework { templateDomToUpdate.CopyFrom(updatedDom, templateDomToUpdate.GetAllocator()); templateToUpdate->get().MarkAsDirty(true); - if (shouldPropagateTemplateChanges) - { - PropagateTemplateChanges(templateId); - } + PropagateTemplateChanges(templateId); } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h index d04b760aae..d4499d1e2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h @@ -187,7 +187,10 @@ namespace AzToolsFramework * @param entities A vector of entities that will be used in the new instance. May be empty * @param instances A vector of Prefab Instances that will be nested in the new instance, will be consumed and moved. * May be empty - * @param filePath the path to associate the template of the new instance to + * @param filePath the path to associate the template of the new instance to. + * @param containerEntity The container entity for the prefab to be created. It will be created if a nullptr is provided. + * @param shouldCreateLinks The flag indicating if links should be created between the templates of the instance + * and its nested instances. * @return A pointer to the newly created instance. nullptr on failure */ AZStd::unique_ptr CreatePrefab( @@ -199,11 +202,11 @@ namespace AzToolsFramework /** * Updates a template with the given updated DOM. - * + * * @param templateId The id of the template to update. * @param updatedDom The DOM to update the template with. */ - void UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom, bool shouldPropagateTemplateChanges = true) override; + void UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom) override; void PropagateTemplateChanges(TemplateId templateId) override; @@ -262,7 +265,9 @@ namespace AzToolsFramework /** * Takes a prefab instance and generates a new Prefab Template * along with any new Prefab Links representing any of the nested instances present - * @param instance The instance used to generate the new Template + * @param instance The instance used to generate the new Template. + * @param shouldCreateLinks The flag indicating if links should be created between the templates of the instance + * and its nested instances. */ TemplateId CreateTemplateFromInstance(Instance& instance, bool shouldCreateLinks); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h index d957a14b61..f0ea99f3dd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h @@ -55,7 +55,7 @@ namespace AzToolsFramework virtual void SetTemplateDirtyFlag(const TemplateId& templateId, bool dirty) = 0; virtual PrefabDom& FindTemplateDom(TemplateId templateId) = 0; - virtual void UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom, bool shouldPropagateTemplateChanges = true) = 0; + virtual void UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom) = 0; virtual void PropagateTemplateChanges(TemplateId templateId) = 0; virtual AZStd::unique_ptr InstantiatePrefab(const TemplateId& templateId) = 0;