From 117cb11505e008f841be1672c5dc72f7e8e31d23 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Fri, 28 Jan 2022 15:43:51 -0600 Subject: [PATCH] {ghi7197} ignore prefab groups with empty JSON DOMS (#7242) * {ghi7197} ignore prefab groups with empty JSON DOMS ignore prefab groups with empty JSON DOMS if the default procedural prefab is being skipped Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * a cleaner solution is to check if the Editor is attempting to construct, then ignore making a default procedural prefab group Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../PrefabGroup/PrefabGroupBehavior.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp index 6bd8f0d049..af21e7297c 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp @@ -166,7 +166,7 @@ namespace AZ::SceneAPI::Behaviors meshNodeFullName.append(meshNodeName.GetName()); auto meshGroup = AZStd::make_shared(); - meshGroup->SetName(meshNodeFullName.c_str()); + meshGroup->SetName(meshNodeFullName); meshGroup->GetSceneNodeSelectionList().AddSelectedNode(AZStd::move(meshNodePath)); for (const auto& meshGoupNamePair : meshTransformMap) { @@ -374,10 +374,18 @@ namespace AZ::SceneAPI::Behaviors Events::ProcessingResult PrefabGroupBehavior::ExportEventHandler::UpdateManifest( Containers::Scene& scene, ManifestAction action, - [[maybe_unused]] RequestingApplication requester) + RequestingApplication requester) { - if (action != Events::AssetImportRequest::ConstructDefault) + if (action == Events::AssetImportRequest::Update) { + // ignore constructing a default procedural prefab if some tool or script is attempting + // to update the scene manifest + return Events::ProcessingResult::Ignored; + } + else if (action == Events::AssetImportRequest::ConstructDefault && requester == RequestingApplication::Editor) + { + // ignore constructing a default procedurla prefab if the Editor's "Edit Settings..." is being used + // the user is trying to assign the source scene asset their own mesh groups return Events::ProcessingResult::Ignored; }