@@ -482,36 +482,22 @@ namespace AzToolsFramework
|
|||||||
AZStd::unique_ptr<Instance>& sourceInstance, TemplateId targetTemplateId, UndoSystem::URSequencePoint* undoBatch)
|
AZStd::unique_ptr<Instance>& sourceInstance, TemplateId targetTemplateId, UndoSystem::URSequencePoint* undoBatch)
|
||||||
{
|
{
|
||||||
LinkReference nestedInstanceLink = m_prefabSystemComponentInterface->FindLink(sourceInstance->GetLinkId());
|
LinkReference nestedInstanceLink = m_prefabSystemComponentInterface->FindLink(sourceInstance->GetLinkId());
|
||||||
if (!nestedInstanceLink)
|
AZ_Assert(
|
||||||
{
|
nestedInstanceLink.has_value(),
|
||||||
AZ_Assert(
|
"A valid link was not found for one of the instances provided as input for the CreatePrefab operation.");
|
||||||
false,
|
|
||||||
"A valid link was not found for one of the instances provided as input for the CreatePrefab operation.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PrefabDomReference nestedInstanceLinkDom = nestedInstanceLink->get().GetLinkDom();
|
PrefabDomReference nestedInstanceLinkDom = nestedInstanceLink->get().GetLinkDom();
|
||||||
|
AZ_Assert(
|
||||||
if (!nestedInstanceLinkDom)
|
nestedInstanceLinkDom.has_value(),
|
||||||
{
|
"A valid DOM was not found for the link corresponding to one of the instances provided as input for the "
|
||||||
AZ_Assert(
|
"CreatePrefab operation.");
|
||||||
false,
|
|
||||||
"A valid DOM was not found for the link corresponding to one of the instances provided as input for the "
|
|
||||||
"CreatePrefab operation.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PrefabDomValueReference nestedInstanceLinkPatches =
|
PrefabDomValueReference nestedInstanceLinkPatches =
|
||||||
PrefabDomUtils::FindPrefabDomValue(nestedInstanceLinkDom->get(), PrefabDomUtils::PatchesName);
|
PrefabDomUtils::FindPrefabDomValue(nestedInstanceLinkDom->get(), PrefabDomUtils::PatchesName);
|
||||||
|
AZ_Assert(
|
||||||
if (!nestedInstanceLinkPatches)
|
nestedInstanceLinkPatches.has_value(),
|
||||||
{
|
"A valid DOM for patches was not found for the link corresponding to one of the instances provided as input for the "
|
||||||
AZ_Assert(
|
"CreatePrefab operation.");
|
||||||
false,
|
|
||||||
"A valid DOM for patches was not found for the link corresponding to one of the instances provided as input for the "
|
|
||||||
"CreatePrefab operation.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PrefabDom patchesCopyForUndoSupport;
|
PrefabDom patchesCopyForUndoSupport;
|
||||||
patchesCopyForUndoSupport.CopyFrom(nestedInstanceLinkPatches->get(), patchesCopyForUndoSupport.GetAllocator());
|
patchesCopyForUndoSupport.CopyFrom(nestedInstanceLinkPatches->get(), patchesCopyForUndoSupport.GetAllocator());
|
||||||
|
|||||||
Reference in New Issue
Block a user