Proc Prefabs: Remove feature toggle (#6348)

* Disable feature flag - redirect proc prefab check to IsPrefabSystemEnabled.

Procedural Prefabs are now on by default when the prefab system is enabled.

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Bump scene builder version to cause all procedural prefabs to rebuild

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Switch to lambda for ebus call

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Remove unused const

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
This commit is contained in:
amzn-mike
2021-12-13 13:52:03 -06:00
committed by GitHub
parent d5980da3d4
commit 45abb9f88e
2 changed files with 17 additions and 13 deletions
@@ -9,12 +9,11 @@
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/Json/RegistrationContext.h>
#include <AzCore/Settings/SettingsRegistry.h>
#include <AzFramework/API/ApplicationAPI.h>
#include <AzFramework/FileFunc/FileFunc.h>
namespace AZ::Prefab
{
static constexpr const char s_useProceduralPrefabsKey[] = "/O3DE/Preferences/Prefabs/UseProceduralPrefabs";
// ProceduralPrefabAsset
ProceduralPrefabAsset::ProceduralPrefabAsset(const AZ::Data::AssetId& assetId)
@@ -58,9 +57,14 @@ namespace AZ::Prefab
bool ProceduralPrefabAsset::UseProceduralPrefabs()
{
bool useProceduralPrefabs = false;
bool result = AZ::SettingsRegistry::Get()->GetObject(useProceduralPrefabs, s_useProceduralPrefabsKey);
return result && useProceduralPrefabs;
bool prefabsEnabled = false;
AzFramework::ApplicationRequests::Bus::Broadcast(
[&prefabsEnabled](AzFramework::ApplicationRequests::Bus::Events* ebus)
{
prefabsEnabled = ebus->IsPrefabSystemEnabled();
});
return prefabsEnabled;
}
// PrefabDomData
@@ -71,7 +71,7 @@ namespace SceneBuilder
context->EnumerateDerived(callback, azrtti_typeid<AZ::SceneAPI::SceneCore::GenerationComponent>(), azrtti_typeid<AZ::SceneAPI::SceneCore::GenerationComponent>());
context->EnumerateDerived(callback, azrtti_typeid<AZ::SceneAPI::SceneCore::LoadingComponent>(), azrtti_typeid<AZ::SceneAPI::SceneCore::LoadingComponent>());
}
AZ::SceneAPI::SceneBuilderDependencyBus::Broadcast(&AZ::SceneAPI::SceneBuilderDependencyRequests::AddFingerprintInfo, fragments);
for (const AZStd::string& element : fragments)
@@ -79,7 +79,7 @@ namespace SceneBuilder
m_cachedFingerprint.append(element);
}
// A general catch all version fingerprint. Update this to force all FBX files to recompile.
m_cachedFingerprint.append("Version 1");
m_cachedFingerprint.append("Version 2");
}
return m_cachedFingerprint.c_str();
@@ -223,7 +223,7 @@ namespace SceneBuilder
// Only used during processing to redirect trace printfs with an warning or error window to the appropriate reporting function.
TraceMessageHook messageHook;
// Load Scene graph and manifest from the provided path and then initialize them.
if (m_isShuttingDown)
{
@@ -282,9 +282,9 @@ namespace SceneBuilder
}
for (const AZStd::string& pathDependency : exportProduct.m_legacyPathDependencies)
{
// SceneCore doesn't have access to AssetBuilderSDK, so it doesn't have access to the
// SceneCore doesn't have access to AssetBuilderSDK, so it doesn't have access to the
// ProductPathDependency type or the ProductPathDependencyType enum. Exporters registered with the
// Scene Builder should report path dependencies on source files as absolute paths, while dependencies
// Scene Builder should report path dependencies on source files as absolute paths, while dependencies
// on product files should be reported as relative paths.
if (AzFramework::StringFunc::Path::IsRelative(pathDependency.c_str()))
{
@@ -314,7 +314,7 @@ namespace SceneBuilder
using namespace AZ::SceneAPI;
using namespace AZ::SceneAPI::Containers;
using namespace AZ::SceneAPI::Events;
AZ_TracePrintf(Utilities::LogWindow, "Loading scene.\n");
SceneSerializationBus::BroadcastResult(result, &SceneSerializationBus::Events::LoadScene, request.m_fullPath, request.m_sourceFileUUID);
@@ -331,7 +331,7 @@ namespace SceneBuilder
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
return false; // Still return false as there's no work so should exit.
}
return true;
}
@@ -379,7 +379,7 @@ namespace SceneBuilder
using namespace AZ::SceneAPI::SceneCore;
AZ_Assert(scene, "Invalid scene passed for exporting.");
const AZStd::string& outputFolder = request.m_tempDirPath;
const char* platformIdentifier = request.m_jobDescription.GetPlatformIdentifier().c_str();
AZ_TraceContext("Output folder", outputFolder.c_str());