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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user