Fixed PhysX and Blast creation of default config files (#4497)

- Avoid saving blast global configuration unnecessarily every time the editor is opened.
- Fixed how to obtain the default physics material library. The relative path needs to be from the project folder, not the asset folder inside the project. It was also missing saving the physx configuration after a the default library is assigned to it.
- Fixed asset id for physics material asset 'assets/physics/surfacetypemateriallibrary.physmaterial'

Signed-off-by: moraaar moraaar@amazon.com
This commit is contained in:
moraaar
2021-10-06 09:46:04 +01:00
committed by GitHub
parent 3eb3df6923
commit 606ba45cf2
11 changed files with 63 additions and 20 deletions
+21 -3
View File
@@ -458,7 +458,13 @@ namespace PhysX
{
const PhysXSystemConfiguration defaultConfig = PhysXSystemConfiguration::CreateDefault();
m_physXSystem->Initialize(&defaultConfig);
registryManager.SaveSystemConfiguration(defaultConfig, {});
auto saveCallback = []([[maybe_unused]] const PhysXSystemConfiguration& config, [[maybe_unused]] PhysXSettingsRegistryManager::Result result)
{
AZ_Warning("PhysX", result == PhysXSettingsRegistryManager::Result::Success,
"Unable to save the default PhysX configuration.");
};
registryManager.SaveSystemConfiguration(defaultConfig, saveCallback);
}
//Load the DefaultSceneConfig
@@ -471,7 +477,13 @@ namespace PhysX
{
const AzPhysics::SceneConfiguration defaultConfig = AzPhysics::SceneConfiguration::CreateDefault();
m_physXSystem->UpdateDefaultSceneConfiguration(defaultConfig);
registryManager.SaveDefaultSceneConfiguration(defaultConfig, {});
auto saveCallback = []([[maybe_unused]] const AzPhysics::SceneConfiguration& config, [[maybe_unused]] PhysXSettingsRegistryManager::Result result)
{
AZ_Warning("PhysX", result == PhysXSettingsRegistryManager::Result::Success,
"Unable to save the default Scene configuration.");
};
registryManager.SaveDefaultSceneConfiguration(defaultConfig, saveCallback);
}
//load the debug configuration and initialize the PhysX debug interface
@@ -486,7 +498,13 @@ namespace PhysX
{
const Debug::DebugConfiguration defaultConfig = Debug::DebugConfiguration::CreateDefault();
debug->Initialize(defaultConfig);
registryManager.SaveDebugConfiguration(defaultConfig, {});
auto saveCallback = []([[maybe_unused]] const Debug::DebugConfiguration& config, [[maybe_unused]] PhysXSettingsRegistryManager::Result result)
{
AZ_Warning("PhysX", result == PhysXSettingsRegistryManager::Result::Success,
"Unable to save the default PhysX Debug configuration.");
};
registryManager.SaveDebugConfiguration(defaultConfig, saveCallback);
}
}
}