Update the FileIO Aliases (#4186)

* Update the FileIOAlias naming to make the cache, project root and engine
root paths more clear

The alias of `@root@`, `@assets@`, and `@projectplatformcache@` has been
collapsed to `@projectproductassets@`

The alias of `@devroot@` and `@engroot@` has been collapsed to
`@engroot@`

The alias of `@devassets@` and `@projectroot@` has been collapsed to
`@projectroot@`

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated use of devassets and devroot properties in python

Those properties now use projectroot and engroot

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updating the alias @engroot@ alias path comment in each platform specific LocalFileIO_*.cpp file

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removed hardcoded size of 9 for the product asset alias.

The ResolvePath function now just appends the @projectproductassets@
alias with the input path

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Remove duplicate @projectproductassets@ check in ProcessFileTreeRequest

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fix for typos in Hydra python test

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated LocalFileIO::Copy call on Windows to use the Unicode aware CopyFileW API

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the AWSMetreicsGemAllocatorFixture to properly suppress asset
cache write errors for Test file creation.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removed unneeded call to set the @projectproductasstes@ alias at the bottom of the AssetSeedManagerTest SetUp

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Added a deprecated alias map to the FileIO System

When a deprecated alias is accessed, the FileIO System logs an AZ_Error and indicates the alias that should be used

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated python test scripts to use the projectroot binding

Retrieving the AutomatedTesting project path based on "<devroot>/AutomatedTesting" has been removed.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated references to devroot and devgame within the codebase

The GetAbsoluteDevGameFolderPath functions has been replaced with direct call to AZ::Utils::GetProjectPath
The GetAbsoluteDevRootFolderPath functions has been replaced with direct calls to AZ::Utils::GetEnginePath

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated <engroot>/AutomatedTesting references to projectroot


Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Replaced references that assumes the project path is <engroot>/AutomatedTesting with <projectroot> in the AutomatedTesting python test

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Correct casing in emfxworkspace file


Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removed newly added AppendPathParts function
Removed the Path constructors which accepts a PathIterable instance

The PathIterable isn't safe to return to a user of the Path class as it might be referencing temporary paths supplied via PathView arguments

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed unused parameter warning

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Undid change to the LexicallyProximate function to set the path result to the base path.

It needs to return the *this path if the pathResult is empty

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Moved the LocalFileIO ConvertToAbsolutePath implementations to AZ::Utils

Fixed the ConvertToAbsolutePath implementation for Unix platforms to use a buffer that is size PATH_MAX(4096 on all our supported Unix platforms).
Because the buffer before was AZ::IO::MaxPathLength which as a size of 1024, this was resulting in the Unix `realpath` function smashing the stack when it converts a path to an absolute path that is longer than 1024 characters

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the EditorCore.Tests to attach the AZ Environment to the EditorCore shared library that is statically loaded on launch.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed for DeprecatedAlaisesKeyVisitor Visit function causing the non string_view overloads being hidden causing a hidden base class function warning

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Changed the AWSMetricsGemMock to use a temporary for writing test assets

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the LocalFileIO::ResolvePath function to use HasRootPath to determine if a path starts with a root path such as "D:", "D:/" or "/"

IsAbsolute was not the corect check as the path of "D:" is a relative
path.
To be absolute according to the Windows the path must have a root
directory. i.e "D:/" or "D:\"

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removed absolute path comment from LocalFile_UnixLike.cpp and LocalFile_Android.cpp FindFiles implementations
Updated the ConvertToAlias to supply an AZ::IO::FixedMaxPath

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Replaced usage of the @projectproductassets@ alias with @engroot@ when referring to the LmbrCentral source folder in the CopyDependencyBuilderTest and the SeedBuilderTests

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the ScriptCanvas Upgrade Tool to output backed up files to the
Project User Path instead of the engine root

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed whitespacing issues in Application.cpp

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Remove unnecessary creation of a FixedMaxPath in the UpgradeTool.cpp

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Modified testSeedFolder variable in the SeedBuilderTests to use the
@engroot@ alias instead of @projectproductassets@/.. alias when
referring to the LmbrCentral Gem source path

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated references to the Project Asset Cache in the PythonTests.

Those tests no longer use the logic `azlmbr.paths.projectroot / "Cache" / "pc"` to retrieve a path to the cache root but instead the `azlmbr.paths.projectproductassets` constant

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed the FileIO Deprecated Alias test on Windows

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removing @projectsourceassets@ alias, as it is only used once.

Updated the PhysX EditorSystemComponent.cpp to query the ProjectPath
form the SettingsRegistry.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Replaced @projectproductassets@ alias with @products@

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Rollback changes to the PhysX EditorSystemComponent.cpp

The changes to use the ProjectPath from the SettingsRegistry has been implemented in PR #4497

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
lumberyard-employee-dm
2021-10-05 15:12:53 -05:00
committed by GitHub
parent 643bd84739
commit f648cb1fd8
209 changed files with 1365 additions and 1678 deletions
@@ -64,7 +64,7 @@ namespace AWSCore
void AWSCoreConfiguration::InitSourceProjectFolderPath()
{
auto sourceProjectFolder = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
auto sourceProjectFolder = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
if (!sourceProjectFolder)
{
AZ_Error(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage);
@@ -197,7 +197,7 @@ namespace AWSCore
subMenu->addAction(AddExternalLinkAction(
AWSMetricsAdvancedTopicsActionText, AWSMetricsAdvancedTopicsUrl, ":/Notifications/link.svg"));
AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@");
AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@engroot@");
AZStd::string configFilePath = priorAlias + "\\Gems\\AWSMetrics\\Code\\" + AZ::SettingsRegistryInterface::RegistryFolder;
AzFramework::StringFunc::Path::Normalize(configFilePath);
@@ -60,7 +60,7 @@ public:
m_normalizedSourceProjectFolder.c_str(), AZ::SettingsRegistryInterface::RegistryFolder);
AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFolderPath);
m_localFileIO->SetAlias("@devassets@", m_normalizedSourceProjectFolder.c_str());
m_localFileIO->SetAlias("@projectroot@", m_normalizedSourceProjectFolder.c_str());
CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG);
}
@@ -122,7 +122,7 @@ private:
TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath)
{
m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {});
m_localFileIO->ClearAlias("@devassets@");
m_localFileIO->ClearAlias("@projectroot@");
AZ_TEST_START_TRACE_SUPPRESSION;
m_awsCoreConfiguration->InitConfig();
@@ -154,7 +154,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonE
TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath)
{
m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {});
m_localFileIO->ClearAlias("@devassets@");
m_localFileIO->ClearAlias("@projectroot@");
m_awsCoreConfiguration->ReloadConfiguration();
auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath();
@@ -32,7 +32,7 @@ class AWSCoreEditorMenuTest
{
AWSCoreEditorUIFixture::SetUp();
AWSCoreFixture::SetUp();
m_localFileIO->SetAlias("@devroot@", "dummy engine root");
m_localFileIO->SetAlias("@engroot@", "dummy engine root");
}
void TearDown() override
@@ -22,7 +22,7 @@ namespace AWSMetrics
AZStd::string IdentityProvider::GetEngineVersion()
{
static constexpr const char* EngineConfigFilePath = "@root@/engine.json";
static constexpr const char* EngineConfigFilePath = "@products@/engine.json";
static constexpr const char* EngineVersionJsonKey = "O3DEVersion";
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetDirectInstance();
+28 -12
View File
@@ -16,8 +16,8 @@
#include <AzCore/Serialization/Json/RegistrationContext.h>
#include <AzCore/Settings/SettingsRegistryImpl.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/IO/LocalFileIO.h>
#include <AzFramework/StringFunc/StringFunc.h>
namespace AWSMetrics
{
@@ -34,15 +34,22 @@ namespace AWSMetrics
// Set up the file IO and alias
m_localFileIO = aznew AZ::IO::LocalFileIO();
m_priorFileIO = AZ::IO::FileIOBase::GetInstance();
// we need to set it to nullptr first because otherwise the
// we need to set it to nullptr first because otherwise the
// underneath code assumes that we might be leaking the previous instance
AZ::IO::FileIOBase::SetInstance(nullptr);
AZ::IO::FileIOBase::SetInstance(m_localFileIO);
const AZStd::string engineRoot = AZ::Test::GetEngineRootPath();
m_localFileIO->SetAlias("@devroot@", engineRoot.c_str());
m_localFileIO->SetAlias("@root@", engineRoot.c_str());
m_localFileIO->SetAlias("@user@", GetTestFolderPath().c_str());
const AZ::IO::Path engineRoot = AZ::Test::GetEngineRootPath();
const auto productAssetPath = GetTestFolderPath() / "Cache";
const auto userPath = GetTestFolderPath() / "user";
m_localFileIO->CreatePath(productAssetPath.c_str());
m_localFileIO->CreatePath(userPath.c_str());
m_localFileIO->SetAlias("@engroot@", engineRoot.c_str());
m_localFileIO->SetAlias("@products@", productAssetPath.c_str());
m_localFileIO->SetAlias("@user@", userPath.c_str());
// Copy engine.json to the cache
EXPECT_TRUE(m_localFileIO->Copy((engineRoot / "engine.json").c_str(), "engine.json"));
m_serializeContext = AZStd::make_unique<AZ::SerializeContext>();
m_registrationContext = AZStd::make_unique<AZ::JsonRegistrationContext>();
@@ -69,6 +76,13 @@ namespace AWSMetrics
m_serializeContext.reset();
m_registrationContext.reset();
const auto productAssetPath = GetTestFolderPath() / "Cache";
const auto userPath = GetTestFolderPath() / "user";
// Clear the product asset cache alias to prevent cache write errors
m_localFileIO->ClearAlias("@products@");
m_localFileIO->DestroyPath(userPath.c_str());
m_localFileIO->DestroyPath(productAssetPath.c_str());
AZ::IO::FileIOBase::SetInstance(nullptr);
delete m_localFileIO;
AZ::IO::FileIOBase::SetInstance(m_priorFileIO);
@@ -97,22 +111,22 @@ namespace AWSMetrics
bool CreateFile(const AZStd::string& filePath, const AZStd::string& content)
{
AZ::IO::HandleType fileHandle;
// Suppress errors about writing to product asset cache
AZ_TEST_START_TRACE_SUPPRESSION;
if (!m_localFileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle))
{
return false;
}
m_localFileIO->Write(fileHandle, content.c_str(), content.size());
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
m_localFileIO->Close(fileHandle);
return true;
}
AZStd::string GetDefaultTestFilePath()
{
AZStd::string testFilePath = GetTestFolderPath();
AzFramework::StringFunc::Path::Join(testFilePath.c_str(), "Test.json", testFilePath);
return testFilePath;
return (GetTestFolderPath() / "Test.json").Native();
}
bool RemoveFile(const AZStd::string& filePath)
@@ -133,14 +147,16 @@ namespace AWSMetrics
AZ::IO::FileIOBase* m_priorFileIO = nullptr;
AZ::IO::FileIOBase* m_localFileIO = nullptr;
AZ::Test::ScopedAutoTempDirectory m_testDirectory;
AZStd::unique_ptr<AZ::SerializeContext> m_serializeContext;
AZStd::unique_ptr<AZ::JsonRegistrationContext> m_registrationContext;
AZStd::unique_ptr<AZ::SettingsRegistryImpl> m_settingsRegistry;
private:
AZStd::string GetTestFolderPath()
AZ::IO::Path GetTestFolderPath()
{
return AZ_TRAIT_TEST_ROOT_FOLDER;
AZ::IO::Path testPathString{ m_testDirectory.GetDirectory() };
return testPathString;
}
};
}
@@ -142,14 +142,14 @@ namespace AssetValidation
system.GetIConsole()->AddCommand("addseedlist", ConsoleCommandAddSeedList);
system.GetIConsole()->AddCommand("removeseedlist", ConsoleCommandRemoveSeedList);
system.GetIConsole()->AddCommand("printexcluded", ConsoleCommandTogglePrintExcluded);
}
}
bool AssetValidationSystemComponent::IsKnownAsset(const char* assetPath)
{
AZStd::string lowerAsset{ assetPath };
AZStd::replace(lowerAsset.begin(), lowerAsset.end(), AZ_WRONG_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR);
const AZStd::vector<AZStd::string> prefixes = { "./", "@assets@/" };
const AZStd::vector<AZStd::string> prefixes = { "./", "@products@/" };
for (const AZStd::string& prefix : prefixes)
{
if (lowerAsset.starts_with(prefix))
@@ -392,7 +392,7 @@ namespace AssetValidation
AssetValidationRequestBus::Broadcast(&AssetValidationRequestBus::Events::AddSeedList, seedfilepath);
}
bool AssetValidationSystemComponent::AddSeedsFor(const AzFramework::AssetSeedList& seedList, AZ::u32 seedId)
bool AssetValidationSystemComponent::AddSeedsFor(const AzFramework::AssetSeedList& seedList, AZ::u32 seedId)
{
for (const AzFramework::SeedInfo& thisSeed : seedList)
{
@@ -401,7 +401,7 @@ namespace AssetValidation
return true;
}
bool AssetValidationSystemComponent::RemoveSeedsFor(const AzFramework::AssetSeedList& seedList, AZ::u32 seedId)
bool AssetValidationSystemComponent::RemoveSeedsFor(const AzFramework::AssetSeedList& seedList, AZ::u32 seedId)
{
AssetValidationRequests::AssetSourceList removeList;
for (const AzFramework::SeedInfo& thisSeed : seedList)
@@ -244,7 +244,7 @@ namespace ImageProcessingAtom
}
AZ::IO::FixedMaxPath projectConfigFolder;
if (auto sourceGameRoot = fileIoBase->ResolvePath("@devassets@"); sourceGameRoot.has_value())
if (auto sourceGameRoot = fileIoBase->ResolvePath("@projectroot@"); sourceGameRoot.has_value())
{
projectConfigFolder = *sourceGameRoot;
projectConfigFolder /= s_projectConfigRelativeFolder;
@@ -139,16 +139,16 @@ namespace AZ
//! Validates if a given .shadervariantlist file is located at the correct path for a given .shader full path.
//! There are two valid paths:
//! 1- Lower Precedence: The same folder where the .shader file is located.
//! 2- Higher Precedence: <DEVROOT>/<GAME>/ShaderVariants/<Same Scan Folder Subpath as the .shader file>.
//! 2- Higher Precedence: <project-path>/ShaderVariants/<Same Scan Folder Subpath as the .shader file>.
//! The "Higher Precedence" path gives the option to game projects to override what variants to generate. If this
//! file exists then the "Lower Precedence" path is disregarded.
//! A .shader full path is located under an AP scan folder.
//! Example: "<DEVROOT>/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader"
//! - In this example the Scan Folder is "<DEVROOT>/Gems/Atom/Feature/Common/Assets", while the subfolder is "Materials/Types".
//! Example: "<atom-gem-path>/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader"
//! - In this example the Scan Folder is "<atom-gem-path>/Gems/Atom/Feature/Common/Assets", while the subfolder is "Materials/Types".
//! The "Higher Precedence" expected valid location for the .shadervariantlist would be:
//! - <DEVROOT>/<GameProject>/ShaderVariants/Materials/Types/StandardPBR_ForwardPass.shadervariantlist.
//! - <atom-gem-path>/<GameProject>/ShaderVariants/Materials/Types/StandardPBR_ForwardPass.shadervariantlist.
//! The "Lower Precedence" valid location would be:
//! - <DEVROOT>/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shadervariantlist.
//! - <atom-gem-path>/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shadervariantlist.
//! @shouldExitEarlyFromProcessJob [out] Set to true if ProcessJob should do no work but return successfully.
//! Set to false if ProcessJob should do work and create assets.
//! When @shaderVariantListFileFullPath is provided by a Gem/Feature instead of the Game Project
@@ -169,17 +169,13 @@ namespace AZ
AZStd::string shaderVariantListFileRelativePath = shaderProductFileRelativePath;
AzFramework::StringFunc::Path::ReplaceExtension(shaderVariantListFileRelativePath, RPI::ShaderVariantListSourceData::Extension);
const char * gameProjectPath = nullptr;
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(gameProjectPath, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAbsoluteDevGameFolderPath);
AZ::IO::FixedMaxPath gameProjectPath = AZ::Utils::GetProjectPath();
AZStd::string expectedHigherPrecedenceFileFullPath;
AzFramework::StringFunc::Path::Join(gameProjectPath, RPI::ShaderVariantTreeAsset::CommonSubFolder, expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */);
AzFramework::StringFunc::Path::Join(expectedHigherPrecedenceFileFullPath.c_str(), shaderProductFileRelativePath.c_str(), expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */);
AzFramework::StringFunc::Path::ReplaceExtension(expectedHigherPrecedenceFileFullPath, AZ::RPI::ShaderVariantListSourceData::Extension);
AzFramework::StringFunc::Path::Normalize(expectedHigherPrecedenceFileFullPath);
auto expectedHigherPrecedenceFileFullPath = (gameProjectPath
/ RPI::ShaderVariantTreeAsset::CommonSubFolder / shaderProductFileRelativePath).LexicallyNormal();
expectedHigherPrecedenceFileFullPath.ReplaceExtension(AZ::RPI::ShaderVariantListSourceData::Extension);
AZStd::string normalizedShaderVariantListFileFullPath = shaderVariantListFileFullPath;
AzFramework::StringFunc::Path::Normalize(normalizedShaderVariantListFileFullPath);
auto normalizedShaderVariantListFileFullPath = AZ::IO::FixedMaxPath(shaderVariantListFileFullPath).LexicallyNormal();
if (expectedHigherPrecedenceFileFullPath == normalizedShaderVariantListFileFullPath)
{
@@ -203,23 +199,15 @@ namespace AZ
}
// Check the "Lower Precedence" case, .shader path == .shadervariantlist path.
AZStd::string normalizedShaderFileFullPath = shaderFileFullPath;
AzFramework::StringFunc::Path::Normalize(normalizedShaderFileFullPath);
AZ::IO::Path normalizedShaderFileFullPath = AZ::IO::Path(shaderFileFullPath).LexicallyNormal();
AZStd::string normalizedShaderFileFullPathWithoutExtension = normalizedShaderFileFullPath;
AzFramework::StringFunc::Path::StripExtension(normalizedShaderFileFullPathWithoutExtension);
auto normalizedShaderFileFullPathWithoutExtension = normalizedShaderFileFullPath;
normalizedShaderFileFullPathWithoutExtension.ReplaceExtension("");
AZStd::string normalizedShaderVariantListFileFullPathWithoutExtension = normalizedShaderVariantListFileFullPath;
AzFramework::StringFunc::Path::StripExtension(normalizedShaderVariantListFileFullPathWithoutExtension);
auto normalizedShaderVariantListFileFullPathWithoutExtension = normalizedShaderVariantListFileFullPath;
normalizedShaderVariantListFileFullPathWithoutExtension.ReplaceExtension("");
#if AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS
//In certain circumstances, the capitalization of the drive letter may not match
const bool caseSensitive = false;
#else
//On the other platforms there's no drive letter, so it should be a non-issue.
const bool caseSensitive = true;
#endif
if (!StringFunc::Equal(normalizedShaderFileFullPathWithoutExtension.c_str(), normalizedShaderVariantListFileFullPathWithoutExtension.c_str(), caseSensitive))
if (normalizedShaderFileFullPathWithoutExtension != normalizedShaderVariantListFileFullPathWithoutExtension)
{
AZ_Error(ShaderVariantAssetBuilderName, false, "For shader file at path [%s], the shader variant list [%s] is expected to be located at [%s.%s] or [%s]"
, normalizedShaderFileFullPath.c_str(), normalizedShaderVariantListFileFullPath.c_str(),
+1 -1
View File
@@ -28,7 +28,7 @@ namespace UnitTest
m_application.reset();
}
static constexpr const char TestDataFolder[] = "@devroot@/Gems/Atom/RHI/Code/Tests/UtilsTestsData/";
static constexpr const char TestDataFolder[] = "@engroot@/Gems/Atom/RHI/Code/Tests/UtilsTestsData/";
AZStd::unique_ptr<AzFramework::Application> m_application;
};
@@ -44,14 +44,14 @@ namespace AZ
AZStd::string GetSourcePathByAssetId(const AZ::Data::AssetId& assetId);
//! Tries to resolve a relative file reference, given the path of a referencing file.
//! @param originatingSourceFilePath Path to the parent file that references referencedSourceFilePath. May be absolute or relative to asset-root.
//! @param originatingSourceFilePath Path to the parent file that references referencedSourceFilePath. May be absolute or relative to asset-root.
//! @param referencedSourceFilePath Path that the parent file references. May be relative to the parent file location or relative to asset-root.
//! @return A full path for referencedSourceFilePath, if a full path was found. If a full path could not be constructed, returns referencedSourceFilePath unmodified.
AZStd::string ResolvePathReference(const AZStd::string& originatingSourceFilePath, const AZStd::string& referencedSourceFilePath);
//! Returns the list of paths where a source asset file could possibly appear.
//! Returns the list of paths where a source asset file could possibly appear.
//! This is intended for use by AssetBuilders when reporting dependencies, to support relative paths between source files.
//! When a source data file references another file using a relative path, the path might be relative to the originating
//! When a source data file references another file using a relative path, the path might be relative to the originating
//! file or it might be a standard source asset path (i.e. relative to the logical asset-root). This function will help reporting
//! dependencies on all possible locations where that file may appear at some point in the future.
//! For example a file MyGem/Assets/Foo/a.json might reference another file as "Bar/b.json". In this case, calling
@@ -94,9 +94,9 @@ namespace AZ
template<typename AssetDataT>
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, [[maybe_unused]] const char* sourcePathForDebug)
{
if (nullptr == AZ::IO::FileIOBase::GetInstance()->GetAlias("@assets@"))
if (nullptr == AZ::IO::FileIOBase::GetInstance()->GetAlias("@products@"))
{
// The absence of "@assets@" is not necessarily the reason LoadAsset() can't be used in CreateJobs(), but it
// The absence of "@products@" is not necessarily the reason LoadAsset() can't be used in CreateJobs(), but it
// is a symptom of calling LoadAsset() from CreateJobs() which is not supported.
AZ_Assert(false, "It appears AssetUtils::LoadAsset() is being called in CreateJobs(). It can only be used in ProcessJob().");
return AZ::Failure();
@@ -53,16 +53,6 @@ namespace UnitTest
return false;
}
const char* AssetSystemStub::GetAbsoluteDevGameFolderPath()
{
return nullptr;
}
const char* AssetSystemStub::GetAbsoluteDevRootFolderPath()
{
return nullptr;
}
bool AssetSystemStub::GetRelativeProductPathFromFullSourceOrProductPath([[maybe_unused]] const AZStd::string& fullPath, [[maybe_unused]] AZStd::string& relativeProductPath)
{
return false;
@@ -56,8 +56,6 @@ namespace UnitTest
AZStd::unordered_map<AZStd::string, SourceInfo> m_sourceInfoMap;
bool GetSourceInfoBySourcePath(const char* sourcePath, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder) override;
const char* GetAbsoluteDevGameFolderPath() override;
const char* GetAbsoluteDevRootFolderPath() override;
bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& relativeProductPath) override;
bool GenerateRelativeSourcePath(
const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& watchFolder) override;
@@ -67,7 +67,7 @@ namespace UnitTest
AZ::IO::Path assetPath = AZStd::string_view{ AZ::Utils::GetProjectPath() };
assetPath /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@assets@", assetPath.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetPath.c_str());
m_jsonRegistrationContext = AZStd::make_unique<AZ::JsonRegistrationContext>();
m_jsonSystemComponent = AZStd::make_unique<AZ::JsonSystemComponent>();
@@ -90,7 +90,7 @@ namespace UnitTest
JobManagerThreadDesc threadDesc;
#if AZ_TRAIT_SET_JOB_PROCESSOR_ID
threadDesc.m_cpuId = 0; // Don't set processors IDs on windows
#endif
#endif
uint32_t numWorkerThreads = AZStd::thread::hardware_concurrency();
@@ -99,7 +99,7 @@ namespace UnitTest
desc.m_workerThreads.push_back(threadDesc);
#if AZ_TRAIT_SET_JOB_PROCESSOR_ID
threadDesc.m_cpuId++;
#endif
#endif
}
m_jobManager = AZStd::make_unique<JobManager>(desc);
@@ -173,7 +173,7 @@ namespace AtomToolsFramework
AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotificationBus::Broadcast(
&AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotifications::OnDatabaseInitialized);
AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::LoadCatalog, "@assets@/assetcatalog.xml");
AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::LoadCatalog, "@products@/assetcatalog.xml");
if (!AZ::RPI::RPISystemInterface::Get()->IsInitialized())
{
@@ -289,7 +289,7 @@ namespace AtomToolsFramework
ExitMainLoop();
}
}
void AtomToolsApplication::SaveSettings()
{
if (m_activatedLocalUserSettings)
@@ -378,7 +378,7 @@ namespace AtomToolsFramework
ExitMainLoop();
}
}
bool AtomToolsApplication::LaunchLocalServer()
{
// Determine if this is the first launch of the tool by attempting to connect to a running server
@@ -24,7 +24,7 @@
namespace MaterialEditor
{
CreateMaterialDialog::CreateMaterialDialog(QWidget* parent)
: CreateMaterialDialog(QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@")) + AZ_CORRECT_FILESYSTEM_SEPARATOR + "Materials", parent)
: CreateMaterialDialog(QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@")) + AZ_CORRECT_FILESYSTEM_SEPARATOR + "Materials", parent)
{
}
@@ -106,7 +106,7 @@ namespace MaterialEditor
menu->addAction("Create Material...", [entry]()
{
const QString defaultPath = AtomToolsFramework::GetUniqueFileInfo(
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@")) +
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@")) +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "Materials" +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "untitled." +
AZ::RPI::MaterialSourceData::Extension).absoluteFilePath();
@@ -182,7 +182,7 @@ namespace MaterialEditor
menu->addAction("Create Child Material...", [entry]()
{
const QString defaultPath = AtomToolsFramework::GetUniqueFileInfo(
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@")) +
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@")) +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "Materials" +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "untitled." +
AZ::RPI::MaterialSourceData::Extension).absoluteFilePath();
@@ -346,7 +346,7 @@ namespace MaterialEditor
AZStd::string ViewportSettingsInspector::GetDefaultUniqueSaveFilePath(const AZStd::string& baseName) const
{
AZStd::string savePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
AZStd::string savePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
savePath += AZ_CORRECT_FILESYSTEM_SEPARATOR;
savePath += "Materials";
savePath += AZ_CORRECT_FILESYSTEM_SEPARATOR;
@@ -16,10 +16,10 @@ import sys
import os.path
import filecmp
g_devroot = azlmbr.paths.devroot
sys.path.append(os.path.join(g_devroot, 'Tests', 'Atom', 'Automated'))
g_engroot = azlmbr.paths.engroot
sys.path.append(os.path.join(g_engroot, 'Tests', 'Atom', 'Automated'))
g_materialTestFolder = os.path.join(g_devroot,'Gems','Atom','TestData','TestData','Materials','StandardPbrTestCases')
g_materialTestFolder = os.path.join(g_engroot,'Gems','Atom','TestData','TestData','Materials','StandardPbrTestCases')
# Change this to True to replace the expected screenshot images
g_replaceExpectedScreenshots = False
@@ -135,7 +135,7 @@ def main():
# clean previously generated shader variant list file so they don't clash.
pre, ext = os.path.splitext(shaderAssetInfo.relativePath)
projectShaderVariantListFilePath = os.path.join(azlmbr.paths.devassets, PROJECT_SHADER_VARIANTS_FOLDER, f'{pre}.shadervariantlist')
projectShaderVariantListFilePath = os.path.join(azlmbr.paths.projectroot, PROJECT_SHADER_VARIANTS_FOLDER, f'{pre}.shadervariantlist')
pre, ext = os.path.splitext(filename)
defaultShaderVariantListFilePath = f'{pre}.shadervariantlist'
@@ -46,7 +46,7 @@ static void DumfontTexture(IConsoleCmdArgs* cmdArgs)
if (fontName && *fontName && *fontName != '0')
{
AZStd::string fontFilePath("@devroot@/");
AZStd::string fontFilePath("@engroot@/");
fontFilePath += fontName;
fontFilePath += ".bmp";
@@ -389,7 +389,7 @@ namespace AZ
// create the full paths
char projectPath[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", projectPath, AZ_MAX_PATH_LEN);
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@projectroot@", projectPath, AZ_MAX_PATH_LEN);
AZStd::string irradianceTextureFullPath;
AzFramework::StringFunc::Path::Join(projectPath, irradianceTextureRelativePath.c_str(), irradianceTextureFullPath, true, true);
@@ -481,7 +481,7 @@ namespace AZ
AZStd::string fullPath;
char projectPath[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", projectPath, AZ_MAX_PATH_LEN);
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@projectroot@", projectPath, AZ_MAX_PATH_LEN);
if (!relativePath.empty())
{
@@ -529,7 +529,7 @@ namespace AZ
bool MaterialPropertyInspector::SaveMaterial() const
{
const QString defaultPath = AtomToolsFramework::GetUniqueFileInfo(
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@")) +
QString(AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@")) +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "Materials" +
AZ_CORRECT_FILESYSTEM_SEPARATOR + "untitled." +
AZ::RPI::MaterialSourceData::Extension).absoluteFilePath();
@@ -321,7 +321,7 @@ namespace AZ
}
char projectPath[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", projectPath, AZ_MAX_PATH_LEN);
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@projectroot@", projectPath, AZ_MAX_PATH_LEN);
// retrieve the source cubemap path from the configuration
// we need to make sure to use the same source cubemap for each bake
@@ -105,7 +105,7 @@ namespace AudioControlBuilder
Audio::ATLXmlTags::ATLPreloadRequestTag, "preload request"));
}
// For each preload request in the control file, determine which config group is used for this platform and register each
// For each preload request in the control file, determine which config group is used for this platform and register each
// bank listed in that preload request as a dependency.
while (preloadRequestNode)
{
@@ -163,7 +163,7 @@ namespace AudioControlBuilder
const AZ::rapidxml::xml_node<char>* configGroupNode = configGroupMap[configGroupName];
if (!configGroupNode)
{
// The config group this platform uses isn't defined in the control file. This might be intentional, so just
// The config group this platform uses isn't defined in the control file. This might be intentional, so just
// generate a warning and keep going to the next preload node.
AZ_TracePrintf("Audio Control Builder", "%s node for config group %s is not defined, so no banks are referenced.",
Audio::ATLXmlTags::ATLConfigGroupTag, configGroupName.c_str());
@@ -188,7 +188,7 @@ namespace AudioControlBuilder
}
// Prepend the bank name with the relative path to the wwise sounds folder to get relative path to the bank from
// the @assets@ alias and push that into the list of banks referenced.
// the @products@ alias and push that into the list of banks referenced.
AZStd::string soundsPrefix = Audio::Wwise::DefaultBanksPath;
banksReferenced.emplace_back(soundsPrefix + bankNameAttribute->value());
@@ -496,7 +496,7 @@ namespace AudioControlBuilder
pathDependencies.emplace(relativeBankPath, AssetBuilderSDK::ProductPathDependencyType::ProductFile);
}
// For each bank figure out what events are included in the bank, then run through every event referenced in the file and
// For each bank figure out what events are included in the bank, then run through every event referenced in the file and
// make sure it is in the list gathered from the banks.
const auto triggersNode = node->first_node(Audio::ATLXmlTags::TriggersNodeTag);
if (!triggersNode)
@@ -520,7 +520,7 @@ namespace AudioControlBuilder
AZStd::set<AZStd::string> wwiseEventsInReferencedBanks;
// Load all bankdeps files for all banks referenced and aggregate the list of events in those files.
// Load all bankdeps files for all banks referenced and aggregate the list of events in those files.
for (const AZStd::string& relativeBankPath : banksReferenced)
{
// Create the full path to the bankdeps file from the bank file.
@@ -52,7 +52,7 @@ namespace WwiseBuilder
{
fileNames.push_back(dependenciesArray[dependencyIndex].GetString());
}
// The dependency array is empty, which likely means it was modified by hand. However, every bank is dependent
// on init.bnk (other than itself), so just force add it as a dependency here. and emit a warning.
if (fileNames.size() == 0)
@@ -93,7 +93,7 @@ namespace WwiseBuilder
void WwiseBuilderWorker::Initialize()
{
AZ::IO::Path configFile("@devassets@");
AZ::IO::Path configFile("@projectroot@");
configFile /= Audio::Wwise::DefaultBanksPath;
configFile /= Audio::Wwise::ConfigFile;
@@ -180,7 +180,7 @@ namespace WwiseBuilder
{
AZ_TracePrintf(AssetBuilderSDK::InfoWindow, "Starting Job.\n");
AZ::IO::PathView fullPath(request.m_fullPath);
if (m_isShuttingDown)
{
AZ_TracePrintf(AssetBuilderSDK::ErrorWindow, "Cancelled job %s because shutdown was requested.\n", request.m_fullPath.c_str());
@@ -204,7 +204,7 @@ namespace WwiseBuilder
AZ::Outcome<AZStd::string, AZStd::string> gatherProductDependenciesResponse = GatherProductDependencies(request.m_fullPath, request.m_sourceFile, dependencyPaths);
if (!gatherProductDependenciesResponse.IsSuccess())
{
AZ_Error(WwiseBuilderWindowName, false, "Dependency gathering for %s failed. %s",
AZ_Error(WwiseBuilderWindowName, false, "Dependency gathering for %s failed. %s",
request.m_fullPath.c_str(), gatherProductDependenciesResponse.GetError().c_str());
}
else
@@ -28,7 +28,7 @@ protected:
{
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
@@ -39,7 +39,7 @@ protected:
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@assets@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
}
void TearDown() override
@@ -158,7 +158,7 @@ TEST_F(WwiseBuilderTests, WwiseBuilder_InitBank_NoMetadata_NoDependencies)
TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_NoMetadata_NoDependencies)
{
// Should generate a warning after trying to find metadata for the given bank, when the bank is not the init bank.
// Should generate a warning after trying to find metadata for the given bank, when the bank is not the init bank.
// Warning should be about not being able to generate full dependency information without the metadata file.
TestSuccessCaseNoDependencies("test_doesNotExist.bnk", true);
}
@@ -180,15 +180,15 @@ TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_MultipleDependencies)
TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_DependencyArrayNonexistent_NoDependencies)
{
// Should generate a warning when trying to get dependency info from metadata file, but the dependency field does
// not an empty array. Warning should be describing that a dependency on the init bank was added by default, but
// Should generate a warning when trying to get dependency info from metadata file, but the dependency field does
// not an empty array. Warning should be describing that a dependency on the init bank was added by default, but
// the full dependency list could not be generated.
TestSuccessCaseNoDependencies("test_bank7.bnk", true);
}
TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_NoElementsInDependencyArray_NoDependencies)
{
// Should generate a warning when trying to get dependency info from metadata file, but the dependency field is
// Should generate a warning when trying to get dependency info from metadata file, but the dependency field is
// an empty array. Warning should be describing that a dependency on the init bank was added by default, but the
// full dependency list could not be generated.
TestSuccessCaseNoDependencies("test_bank8.bnk", true);
@@ -196,8 +196,8 @@ TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_NoElementsInDependencyArray_N
TEST_F(WwiseBuilderTests, WwiseBuilder_ContentBank_MissingInitBankDependency_MultipleDependencies)
{
// Should generate a warning when trying to get dependency info from metadata file, but the dependency info in the
// metadata doesn't include the init bank. Warning should be describing that a dependency on the init bank was
// Should generate a warning when trying to get dependency info from metadata file, but the dependency info in the
// metadata doesn't include the init bank. Warning should be describing that a dependency on the init bank was
// added by default.
AZStd::vector<const char*> expectedPaths = {
"Sounds/wwise/init.bnk",
@@ -231,7 +231,7 @@ namespace UnitTest
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
@@ -253,10 +253,10 @@ namespace UnitTest
AZ_TEST_ASSERT(serializeContext != nullptr);
Audio::Wwise::ConfigurationSettings::Reflect(serializeContext);
// Set the @assets@ alias to the path where *this* cpp file lives.
// Set the @products@ alias to the path where *this* cpp file lives.
AZStd::string rootFolder(AZ::Test::GetCurrentExecutablePath());
AZ::StringFunc::Path::Join(rootFolder.c_str(), "Test.Assets/Gems/AudioEngineWwise", rootFolder);
m_fileIO->SetAlias("@assets@", rootFolder.c_str());
m_fileIO->SetAlias("@products@", rootFolder.c_str());
// So we don't have to compute it in each test...
AZStd::string defaultBanksPath(Audio::Wwise::DefaultBanksPath);
@@ -303,26 +303,12 @@ namespace UnitTest
m_mapEntry.m_bankSubPath = "soundbanks";
config.m_platformMappings.push_back(m_mapEntry);
// Unfortunately we are writing to the config file that is simulated to be in the @assets@ subfolder
// This will cause an issue during save. Since 'm_configFilePath' is an absolute path, we need to
// reset the @assets@ alias to a meaningful assets path that does not contain any root of the m_configFilePath
// in order to write to the config file and proceed
//AZStd::string rootFolder(AZ::Test::GetCurrentExecutablePath());
//AZ::IO::Path tempAssetPath(rootFolder);
//tempAssetPath /= "Cache";
//AZStd::string previousAlias = m_fileIO->GetAlias("@assets@");
//m_fileIO->SetAlias("@assets@", tempAssetPath.c_str());
config.Save(m_configFilePath);
//m_fileIO->SetAlias("@assets@", previousAlias.c_str());
m_wwiseImpl.SetBankPaths();
//m_fileIO->SetAlias("@assets@", tempAssetPath.c_str());
m_fileIO->Remove(m_configFilePath.c_str());
//m_fileIO->SetAlias("@assets@", previousAlias.c_str());
EXPECT_STREQ(m_wwiseImpl.m_soundbankFolder.c_str(), "sounds/wwise/soundbanks/");
}
@@ -977,7 +977,7 @@ namespace Audio
, m_rPreloadRequests(rPreloadRequests)
, m_nTriggerImplIDCounter(AUDIO_TRIGGER_IMPL_ID_NUM_RESERVED)
, m_rFileCacheMgr(rFileCacheMgr)
, m_rootPath("@assets@")
, m_rootPath("@products@")
#if !defined(AUDIO_RELEASE)
, m_pDebugNameStore(nullptr)
#endif // !AUDIO_RELEASE
@@ -292,7 +292,7 @@ namespace Blast
void BlastSystemComponent::SaveConfiguration()
{
auto assetRoot = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
auto assetRoot = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
if (!assetRoot)
{
@@ -309,7 +309,7 @@ namespace Blast
void BlastSystemComponent::CheckoutConfiguration()
{
const auto assetRoot = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
const auto assetRoot = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
AZStd::string fullPath;
AzFramework::StringFunc::Path::Join(assetRoot, DefaultConfigurationPath, fullPath);
@@ -16,7 +16,7 @@ namespace CertificateManager
{
static bool ReadFileIntoString(const char* filename, AZStd::vector<char>& outBuffer)
{
AZStd::string certificatePath = "@assets@/certificates/";
AZStd::string certificatePath = "@products@/certificates/";
certificatePath.append(filename);
AZ::IO::FileIOBase* fileBase = AZ::IO::FileIOBase::GetInstance();
@@ -58,7 +58,7 @@ namespace CertificateManager
return true;
}
FileDataSource::FileDataSource()
FileDataSource::FileDataSource()
: m_privateKeyPEM(nullptr)
, m_certificatePEM(nullptr)
, m_certificateAuthorityCertPEM(nullptr)
@@ -73,13 +73,13 @@ namespace CertificateManager
azfree(m_privateKeyPEM);
azfree(m_certificatePEM);
azfree(m_certificateAuthorityCertPEM);
}
}
void FileDataSource::ConfigureDataSource(const char* keyPath, const char* certPath, const char* caPath)
{
ConfigurePrivateKey(keyPath);
ConfigureCertificate(certPath);
ConfigureCertificateAuthority(caPath);
ConfigureCertificateAuthority(caPath);
}
void FileDataSource::ConfigurePrivateKey(const char* path)
@@ -107,7 +107,7 @@ namespace CertificateManager
if (path != nullptr)
{
LoadGenericFile(path,m_certificatePEM);
}
}
}
void FileDataSource::ConfigureCertificateAuthority(const char* path)
@@ -133,7 +133,7 @@ namespace CertificateManager
{
return m_certificateAuthorityCertPEM;
}
bool FileDataSource::HasPublicKey() const
{
return m_certificatePEM != nullptr;
@@ -143,7 +143,7 @@ namespace CertificateManager
{
return m_certificatePEM;
}
bool FileDataSource::HasPrivateKey() const
{
return m_privateKeyPEM != nullptr;
@@ -50,7 +50,7 @@ namespace EMotionFX
// Create EMotion FX allocators
Allocators::Create();
// create the new object
gEMFX = AZ::Environment::CreateVariable<EMotionFXManager*>(kEMotionFXInstanceVarName);
gEMFX.Set(EMotionFXManager::Create());
@@ -166,11 +166,11 @@ namespace EMotionFX
delete m_debugDraw;
m_debugDraw = nullptr;
m_eventManager->Destroy();
m_eventManager = nullptr;
// delete the thread datas
for (uint32 i = 0; i < m_threadDatas.size(); ++i)
{
@@ -341,7 +341,7 @@ namespace EMotionFX
void EMotionFXManager::InitAssetFolderPaths()
{
// Initialize the asset source folder path.
const char* assetSourcePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
const char* assetSourcePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
if (assetSourcePath)
{
m_assetSourceFolder = assetSourcePath;
@@ -361,12 +361,12 @@ namespace EMotionFX
}
else
{
AZ_Warning("EMotionFX", false, "Failed to set asset source path for alias '@devassets@'.");
AZ_Warning("EMotionFX", false, "Failed to set asset source path for alias '@projectroot@'.");
}
// Initialize the asset cache folder path.
const char* assetCachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@assets@");
const char* assetCachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@products@");
if (assetCachePath)
{
m_assetCacheFolder = assetCachePath;
@@ -386,7 +386,7 @@ namespace EMotionFX
}
else
{
AZ_Warning("EMotionFX", false, "Failed to set asset cache path for alias '@assets@'.");
AZ_Warning("EMotionFX", false, "Failed to set asset cache path for alias '@products@'.");
}
}
@@ -72,13 +72,13 @@ namespace EMStudio
{
AZStd::string filename;
AZStd::string assetCachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@assets@");
AZStd::string assetCachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@products@");
AzFramework::StringFunc::AssetDatabasePath::Normalize(assetCachePath);
AZStd::string relativePath;
EBUS_EVENT_RESULT(relativePath, AZ::Data::AssetCatalogRequestBus, GetAssetPathById, assetId);
AzFramework::StringFunc::AssetDatabasePath::Join(assetCachePath.c_str(), relativePath.c_str(), filename);
return filename;
}
@@ -243,7 +243,7 @@ namespace EMStudio
void FileManager::SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, [[maybe_unused]] AZ::TypeId sourceTypeId)
{
AZStd::string filename;
AZStd::string assetSourcePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
AZStd::string assetSourcePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@projectroot@");
AzFramework::StringFunc::AssetDatabasePath::Normalize(assetSourcePath);
AzFramework::StringFunc::AssetDatabasePath::Join(assetSourcePath.c_str(), relativePath.c_str(), filename);
@@ -373,7 +373,7 @@ namespace EMStudio
const ProductAssetBrowserEntry* product = azrtti_cast<const ProductAssetBrowserEntry*>(assetBrowserEntry);
filename.clear();
AZStd::string cachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@assets@");
AZStd::string cachePath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@products@");
AzFramework::StringFunc::AssetDatabasePath::Normalize(cachePath);
AzFramework::StringFunc::AssetDatabasePath::Join(cachePath.c_str(), product->GetRelativePath().c_str(), filename);
@@ -395,7 +395,7 @@ namespace EMStudio
{
return AZStd::string();
}
return filenames[0];
}
@@ -435,12 +435,12 @@ namespace EMStudio
AZStd::string result;
if (EMStudio::GetCommandManager()->ExecuteCommand(command, result))
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
"Actor <font color=green>successfully</font> saved");
}
else
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
AZStd::string::format("Actor <font color=red>failed</font> to save<br/><br/>%s", result.c_str()).c_str());
}
}
@@ -574,12 +574,12 @@ namespace EMStudio
AZStd::string result;
if (GetCommandManager()->ExecuteCommand(command, result) == false)
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
AZStd::string::format("MotionSet <font color=red>failed</font> to save<br/><br/>%s", result.c_str()).c_str());
}
else
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
"MotionSet <font color=green>successfully</font> saved");
}
}
@@ -608,7 +608,7 @@ namespace EMStudio
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AZStd::string FileManager::LoadAnimGraphFileDialog([[maybe_unused]] QWidget* parent)
{
GetManager()->SetAvoidRendering(true);
@@ -618,7 +618,7 @@ namespace EMStudio
{
return AZStd::string();
}
return filenames[0];
}
@@ -378,7 +378,7 @@ namespace EMStudio
// reset action
m_resetAction = menu->addAction(tr("&Reset"), this, &MainWindow::OnReset, QKeySequence::New);
m_resetAction->setObjectName("EMFX.MainWindow.ResetAction");
// save all
m_saveAllAction = menu->addAction(tr("Save All..."), this, &MainWindow::OnSaveAll, QKeySequence::Save);
m_saveAllAction->setObjectName("EMFX.MainWindow.SaveAllAction");
@@ -467,7 +467,7 @@ namespace EMStudio
menu->addAction("Documentation", this, []
{
QDesktopServices::openUrl(QUrl("https://o3de.org/docs/"));
});
});
menu->addAction("Forums", this, []
{
@@ -491,7 +491,7 @@ namespace EMStudio
// load preferences
PluginOptionsNotificationsBus::Router::BusRouterConnect();
LoadPreferences();
LoadPreferences();
m_autosaveTimer->setInterval(m_options.GetAutoSaveInterval() * 60 * 1000);
// Create the dirty file manager and register the workspace callback.
@@ -1072,7 +1072,7 @@ namespace EMStudio
// get only the version number of EMotion FX
AZStd::string emfxVersionString = EMotionFX::GetEMotionFX().GetVersionString();
AzFramework::StringFunc::Replace(emfxVersionString, "EMotion FX ", "", true /* case sensitive */);
// set the window title
// only set the EMotion FX version if the filename is empty
AZStd::string windowTitle;
@@ -1359,7 +1359,7 @@ namespace EMStudio
void MainWindow::LoadCharacter(const AZ::Data::AssetId& actorAssetId, const AZ::Data::AssetId& animgraphId, const AZ::Data::AssetId& motionSetId)
{
m_characterFiles.clear();
AZStd::string cachePath = gEnv->pFileIO->GetAlias("@assets@");
AZStd::string cachePath = gEnv->pFileIO->GetAlias("@products@");
AZStd::string filename;
AzFramework::StringFunc::AssetDatabasePath::Normalize(cachePath);
@@ -1543,12 +1543,12 @@ namespace EMStudio
AZStd::string result;
if (EMStudio::GetCommandManager()->ExecuteCommand(command, result))
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
"Workspace <font color=green>successfully</font> saved");
}
else
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
AZStd::string::format("Workspace <font color=red>failed</font> to save<br/><br/>%s", result.c_str()).c_str());
}
}
@@ -1575,12 +1575,12 @@ namespace EMStudio
AZStd::string result;
if (EMStudio::GetCommandManager()->ExecuteCommand(command, result))
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
"Workspace <font color=green>successfully</font> saved");
}
else
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
AZStd::string::format("Workspace <font color=red>failed</font> to save<br/><br/>%s", result.c_str()).c_str());
}
}
@@ -1644,7 +1644,7 @@ namespace EMStudio
Workspace* workspace = GetManager()->GetWorkspace();
workspace->SetDirtyFlag(true);
}
}
void MainWindow::OnReset()
{
@@ -2312,7 +2312,7 @@ namespace EMStudio
void MainWindow::Activate(const AZ::Data::AssetId& actorAssetId, const EMotionFX::AnimGraph* animGraph, const EMotionFX::MotionSet* motionSet)
{
AZStd::string cachePath = gEnv->pFileIO->GetAlias("@assets@");
AZStd::string cachePath = gEnv->pFileIO->GetAlias("@products@");
AZStd::string filename;
AzFramework::StringFunc::AssetDatabasePath::Normalize(cachePath);
@@ -2776,17 +2776,17 @@ namespace EMStudio
AZStd::string result;
if (GetCommandManager()->ExecuteCommandGroup(commandGroup, result, false))
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_SUCCESS,
"Autosave <font color=green>completed</font>");
}
else
{
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
GetNotificationWindowManager()->CreateNotificationWindow(NotificationWindow::TYPE_ERROR,
AZStd::string::format("Autosave <font color=red>failed</font><br/><br/>%s", result.c_str()).c_str());
}
}
void MainWindow::moveEvent(QMoveEvent* event)
{
MCORE_UNUSED(event);
@@ -428,7 +428,7 @@ namespace EMStudio
continue;
}
AzFramework::StringFunc::Replace(commands[i], "@assets@/", assetCacheFolder.c_str(), true /* case sensitive */);
AzFramework::StringFunc::Replace(commands[i], "@products@/", assetCacheFolder.c_str(), true /* case sensitive */);
// add the command to the command group
commandGroup->AddCommandString(commands[i]);
@@ -6,6 +6,8 @@
*
*/
#include <AzCore/Utils/Utils.h>
#include <Integration/Assets/AnimGraphAsset.h>
#include <EMotionFX/Source/Allocators.h>
#include <EMotionFX/Source/AnimGraphManager.h>
@@ -66,14 +68,10 @@ namespace EMotionFX
// through this method. Once EMotionFX is integrated to the asset system this can go away.
AZStd::string assetFilename;
EBUS_EVENT_RESULT(assetFilename, AZ::Data::AssetCatalogRequestBus, GetAssetPathById, asset.GetId());
const char* devAssetsPath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
if (devAssetsPath)
AZ::IO::FixedMaxPath projectPath = AZ::Utils::GetProjectPath();
if (!projectPath.empty())
{
AZStd::string assetSourcePath = devAssetsPath;
AzFramework::StringFunc::AssetDatabasePath::Normalize(assetSourcePath);
AZStd::string filename;
AzFramework::StringFunc::AssetDatabasePath::Join(assetSourcePath.c_str(), assetFilename.c_str(), filename);
AZ::IO::FixedMaxPathString filename{ (projectPath / assetFilename).LexicallyNormal().FixedMaxPathStringAsPosix() };
assetData->m_emfxAnimGraph->SetFileName(filename.c_str());
}
@@ -81,7 +79,7 @@ namespace EMotionFX
{
if (GetEMotionFX().GetIsInEditorMode())
{
AZ_Warning("EMotionFX", false, "Failed to retrieve asset source path with alias '@devassets@'. Cannot set absolute filename for '%s'", assetFilename.c_str());
AZ_Warning("EMotionFX", false, "Failed to retrieve project root path . Cannot set absolute filename for '%s'", assetFilename.c_str());
}
assetData->m_emfxAnimGraph->SetFileName(assetFilename.c_str());
}
@@ -9,6 +9,7 @@
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/Component/TickBus.h>
#include <AzCore/StringFunc/StringFunc.h>
#include <AzCore/Utils/Utils.h>
#include <Integration/Assets/MotionSetAsset.h>
#include <EMotionFX/Source/MotionSet.h>
@@ -46,7 +47,7 @@ namespace EMotionFX
const char* motionFile = entry->GetFilename();
AZ::Data::AssetId motionAssetId;
EBUS_EVENT_RESULT(motionAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, motionFile, azrtti_typeid<MotionAsset>(), false);
// if it failed to find it, it might be still compiling - try forcing an immediate compile:
if (!motionAssetId.IsValid())
{
@@ -149,14 +150,11 @@ namespace EMotionFX
// through this method. Once EMotionFX is integrated to the asset system this can go away.
AZStd::string assetFilename;
EBUS_EVENT_RESULT(assetFilename, AZ::Data::AssetCatalogRequestBus, GetAssetPathById, asset.GetId());
const char* devAssetsPath = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
if (devAssetsPath)
{
AZStd::string assetSourcePath = devAssetsPath;
AZ::StringFunc::AssetDatabasePath::Normalize(assetSourcePath);
AZStd::string filename;
AZ::StringFunc::AssetDatabasePath::Join(assetSourcePath.c_str(), assetFilename.c_str(), filename);
AZ::IO::FixedMaxPath projectPath = AZ::Utils::GetProjectPath();
if (!projectPath.empty())
{
AZ::IO::FixedMaxPathString filename{ (projectPath / assetFilename).LexicallyNormal().FixedMaxPathStringAsPosix() };
assetData->m_emfxMotionSet->SetFilename(filename.c_str());
}
@@ -164,11 +162,11 @@ namespace EMotionFX
{
if (GetEMotionFX().GetIsInEditorMode())
{
AZ_Warning("EMotionFX", false, "Failed to retrieve asset source path with alias '@devassets@'. Cannot set absolute filename for '%s'", assetFilename.c_str());
AZ_Warning("EMotionFX", false, "Failed to retrieve project root path . Cannot set absolute filename for '%s'", assetFilename.c_str());
}
assetData->m_emfxMotionSet->SetFilename(assetFilename.c_str());
}
// now load them in:
const EMotionFX::MotionSet::MotionEntries& motionEntries = assetData->m_emfxMotionSet->GetMotionEntries();
// Get the motions in the motion set. Escalate them to the top of the build queue first so that they can be done in parallel.
@@ -179,7 +177,7 @@ namespace EMotionFX
const char* motionFilename = motionEntry->GetFilename();
AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, motionFilename);
}
// now that they're all escalated, the asset processor will be processing them across all threads, and we can request them one by one:
for (const auto& item : motionEntries)
{
@@ -487,9 +487,9 @@ namespace EMotionFX
return;
}
SetMediaRoot("@assets@");
// \todo Right now we're pointing at the @devassets@ location (source) and working from there, because .actor and .motion (motion) aren't yet processed through
// the scene pipeline. Once they are, we'll need to update various segments of the Tool to always read from the @assets@ cache, but write to the @devassets@ data/metadata.
SetMediaRoot("@products@");
// \todo Right now we're pointing at the @projectroot@ location (source) and working from there, because .actor and .motion (motion) aren't yet processed through
// the scene pipeline. Once they are, we'll need to update various segments of the Tool to always read from the @products@ cache, but write to the @projectroot@ data/metadata.
EMotionFX::GetEMotionFX().InitAssetFolderPaths();
// Register EMotionFX event handler
@@ -25,11 +25,11 @@ namespace EMotionFX
ExecuteCommands({
R"str(CreateMotionSet -name MotionSet0)str",
R"str(CreateMotionSet -name MotionSet1)str",
R"str(MotionSetAddMotion -motionSetID 0 -motionFilenamesAndIds @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle)str",
R"str(MotionSetAddMotion -motionSetID 1 -motionFilenamesAndIds @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle)str",
R"str(MotionSetAddMotion -motionSetID 0 -motionFilenamesAndIds @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle)str",
R"str(MotionSetAddMotion -motionSetID 1 -motionFilenamesAndIds @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle)str",
R"str(MotionSetRemoveMotion -motionSetID 0 -motionIds rin_idle)str",
R"str(RemoveMotionSet -motionSetID 0)str",
R"str(RemoveMotion -filename @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion)str",
R"str(RemoveMotion -filename @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion)str",
});
EMStudio::MotionSetsWindowPlugin* motionSetsWindowPlugin = static_cast<EMStudio::MotionSetsWindowPlugin*>(EMStudio::GetPluginManager()->FindActivePlugin(EMStudio::MotionSetsWindowPlugin::CLASS_ID));
@@ -33,7 +33,7 @@ namespace EMotionFX
ASSERT_TRUE(motionSet) << "Motion set with id 0 does not exist";
motionSetsWindowPlugin->SetSelectedSet(motionSet);
const std::string filename = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion";
const std::string filename = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion";
ExecuteCommands({
"ImportMotion -filename " + filename,
"MotionSetAddMotion -motionSetID 0 -motionFilenamesAndIds " + filename + ";rin_idle",
@@ -55,7 +55,7 @@ namespace EMotionFX
// By using this mock catalog, we can pretend to load the specific referenced assets without actually loading anything.
UnitTest::MockLoadAssetCatalogAndHandler testAssetCatalog({ referencedAnimGraph, referencedMotionSet });
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExample.animgraph";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExample.animgraph";
AZStd::vector<AssetBuilderSDK::ProductDependency> productDependencies;
EMotionFXBuilder::AnimGraphBuilderWorker builderWorker;
@@ -68,7 +68,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestAnimGraphAsset_NoDependency_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExampleNoDependency.animgraph";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExampleNoDependency.animgraph";
AZStd::vector<AssetBuilderSDK::ProductDependency> productDependencies;
EMotionFXBuilder::AnimGraphBuilderWorker builderWorker;
@@ -78,7 +78,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestAnimGraphAsset_InvalidFilePath_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/InvalidPathExample.animgraph";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/InvalidPathExample.animgraph";
AZStd::vector<AssetBuilderSDK::ProductDependency> productDependencies;
EMotionFXBuilder::AnimGraphBuilderWorker builderWorker;
@@ -88,7 +88,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestAnimGraphAsset_EmptyFile_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyAnimGraphExample.animgraph";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyAnimGraphExample.animgraph";
AZStd::vector<AssetBuilderSDK::ProductDependency> productDependencies;
EMotionFXBuilder::AnimGraphBuilderWorker builderWorker;
@@ -100,7 +100,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestMotionSetAsset_HasReferenceNode_OutputProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExample.motionset";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExample.motionset";
ProductPathDependencySet productDependencies;
EMotionFXBuilder::MotionSetBuilderWorker builderWorker;
@@ -112,7 +112,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestMotionSetAsset_NoDependency_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExampleNoDependency.motionset";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExampleNoDependency.motionset";
ProductPathDependencySet productDependencies;
EMotionFXBuilder::MotionSetBuilderWorker builderWorker;
@@ -122,7 +122,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestMotionSetAsset_InvalidFilePath_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/InvalidPathExample.motionset";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/InvalidPathExample.motionset";
ProductPathDependencySet productDependencies;
EMotionFXBuilder::MotionSetBuilderWorker builderWorker;
@@ -132,7 +132,7 @@ namespace EMotionFX
TEST_F(EMotionFXBuilderTests, TestMotionSetAsset_EmptyFile_OutputNoProductDependencies)
{
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyMotionSetExample.motionset";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyMotionSetExample.motionset";
ProductPathDependencySet productDependencies;
EMotionFXBuilder::MotionSetBuilderWorker builderWorker;
@@ -124,7 +124,7 @@ namespace EMotionFX
{
using testing::_;
const AZStd::string fileName = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExample.motionset";
const AZStd::string fileName = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExample.motionset";
MockAssetSystemRequests assetSystem;
EXPECT_CALL(assetSystem, CompileAssetSync(_))
@@ -302,7 +302,7 @@ namespace EMotionFX
GetEMotionFX().SetMediaRootFolder(assetFolder.c_str());
GetEMotionFX().InitAssetFolderPaths();
const char* actorFilename = "@assets@\\animationsamples\\advanced_rinlocomotion\\actor\\rinactor.actor";
const char* actorFilename = "@products@\\animationsamples\\advanced_rinlocomotion\\actor\\rinactor.actor";
Importer* importer = GetEMotionFX().GetImporter();
importer->SetLoggingEnabled(false);
@@ -402,9 +402,9 @@ namespace EMotionFX
// This path points to assets in the advance rin demo.
// To test different assets, change the path here.
const char* actorFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\Actor\\rinActor.actor";
const char* motionSetFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.motionset";
const char* animGraphFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.animgraph";
const char* actorFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\Actor\\rinActor.actor";
const char* motionSetFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.motionset";
const char* animGraphFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.animgraph";
Importer* importer = GetEMotionFX().GetImporter();
importer->SetLoggingEnabled(false);
@@ -714,9 +714,9 @@ namespace EMotionFX
// This path points to assets in the advance rin demo.
// To test different assets, change the path here.
const char* actorFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\Actor\\rinActor.actor";
const char* motionSetFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.motionset";
const char* animGraphFilename = "@assets@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.animgraph";
const char* actorFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\Actor\\rinActor.actor";
const char* motionSetFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.motionset";
const char* animGraphFilename = "@products@\\AnimationSamples\\Advanced_RinLocomotion\\AnimationEditorFiles\\Advanced_RinLocomotion.animgraph";
Importer* importer = GetEMotionFX().GetImporter();
importer->SetLoggingEnabled(false);
@@ -772,13 +772,13 @@ namespace EMotionFX
TEST_F(PerformanceTestFixture, DISABLED_MotionSamplingPerformanceNonUniform)
{
// Make sure that the motion is set to use NonUniform sampling! Change this in the scene settings! Otherwise you get wrong results.
TestMotionSamplingPerformance("@assets@\\animationsamples\\advanced_rinlocomotion\\motions\\rin_idle.motion");
TestMotionSamplingPerformance("@products@\\animationsamples\\advanced_rinlocomotion\\motions\\rin_idle.motion");
}
TEST_F(PerformanceTestFixture, DISABLED_MotionSamplingPerformanceUniform)
{
// Make sure that the motion is set to use Uniform sampling! Change this in the scene settings! Otherwise you get wrong results.
TestMotionSamplingPerformance("@assets@\\animationsamples\\advanced_rinlocomotion\\motions\\rin_walk_kick_01.motion");
TestMotionSamplingPerformance("@products@\\animationsamples\\advanced_rinlocomotion\\motions\\rin_walk_kick_01.motion");
}
} // namespace EMotionFX
@@ -33,7 +33,7 @@ namespace EMotionFX
ASSERT_EQ(GetActorManager().GetNumActors(), 0);
// Load an Actor
const char* actorCmd{ "ImportActor -filename @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor" };
const char* actorCmd{ "ImportActor -filename @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor" };
{
AZStd::string result;
EXPECT_TRUE(CommandSystem::GetCommandManager()->ExecuteCommand(actorCmd, result)) << result.c_str();
@@ -297,16 +297,16 @@ namespace EMotionFX
INSTANTIATE_TEST_CASE_P(Integ_TestPoses, INTEG_PoseComparisonFixture,
::testing::Values(
PoseComparisonFixtureParams (
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.motionset",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.emfxrecording"
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.motionset",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.emfxrecording"
),
PoseComparisonFixtureParams (
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.actor",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.animgraph",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.motionset",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.emfxrecording"
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.actor",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.animgraph",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.motionset",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Pendulum/pendulum.emfxrecording"
)
)
);
@@ -314,10 +314,10 @@ namespace EMotionFX
INSTANTIATE_TEST_CASE_P(Integ_TestPoseComparison, INTEG_TestPoseComparisonFixture,
::testing::Values(
PoseComparisonFixtureParams (
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.motionset",
"@assets@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.emfxrecording"
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.motionset",
"@products@/Test.Assets/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.emfxrecording"
)
)
);
@@ -30,12 +30,12 @@ namespace EMotionFX
motionSetsWindowPlugin->SetSelectedSet(motionSet);
ExecuteCommands({
"ImportMotion -filename @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion",
"MotionSetAddMotion -motionSetID 0 -motionFilenamesAndIds @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle"
"ImportMotion -filename @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion",
"MotionSetAddMotion -motionSetID 0 -motionFilenamesAndIds @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion;rin_idle"
});
char resolvedPath[AZ::IO::MaxPathLength];
EXPECT_TRUE(AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion", resolvedPath, AZ_ARRAY_SIZE(resolvedPath)));
EXPECT_TRUE(AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion", resolvedPath, AZ_ARRAY_SIZE(resolvedPath)));
m_motionFileName = resolvedPath;
AzFramework::ApplicationRequests::Bus::Broadcast([](AzFramework::ApplicationRequests* requests, AZStd::string& path) { requests->NormalizePathKeepCase(path); }, m_motionFileName);
m_motionName = "rin_idle";
@@ -44,7 +44,7 @@ namespace EMotionFX
RecordProperty("test_case_id", "C16302179");
const AZStd::string motionAsset("@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
const AZStd::string motionAsset("@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
const AZStd::string createAnimGraphCmd("CreateAnimGraph");
const AZStd::string motionSetName("TestMotionSet");
const AZStd::string createMotionSetCmd("CreateMotionSet -motionSetID 42 -name " + motionSetName);
@@ -36,7 +36,7 @@ namespace EMotionFX
RecordProperty("test_case_id", "C1559124");
const QString assetName = "rin_idle"; // Asset name to appear in table
const AZStd::string motionCmd = AZStd::string::format("ImportMotion -filename @devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
const AZStd::string motionCmd = AZStd::string::format("ImportMotion -filename @engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
auto motionWindowPlugin = static_cast<EMStudio::MotionWindowPlugin*>(EMStudio::GetPluginManager()->FindActivePlugin(EMStudio::MotionWindowPlugin::CLASS_ID));
ASSERT_TRUE(motionWindowPlugin) << "Could not find the Motion Window Plugin";
@@ -38,7 +38,7 @@ namespace EMotionFX
EXPECT_EQ(table->rowCount(), 1) << "Expected the table to have no rows yet";
// Create actor and actor instance.
const char* actorFilename = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor";
const char* actorFilename = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.actor";
AZStd::unique_ptr<EMotionFX::Actor> m_actor = EMotionFX::GetImporter().LoadActor(actorFilename);
EXPECT_TRUE(m_actor.get() != nullptr) << "Actor not loaded.";
EMotionFX::ActorInstance* m_actorInstance = ActorInstance::Create(m_actor.get());
@@ -26,7 +26,7 @@ namespace EMotionFX
EMStudio::GetMainWindow()->ApplicationModeChanged("AnimGraph");
// Load Rin anim graph.
const char* rinGraph = "@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph";
const char* rinGraph = "@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin.animgraph";
const AZStd::string rinGraphPath = ResolvePath(rinGraph);
AZStd::string command = AZStd::string::format("LoadAnimGraph -filename \"%s\"", rinGraphPath.c_str());
AZStd::string result;
@@ -551,7 +551,7 @@ namespace EMotionFX
QString GetTestMotionFileName() const
{
AZStd::string resolvedAssetPath = this->ResolvePath("@devroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
AZStd::string resolvedAssetPath = this->ResolvePath("@engroot@/Gems/EMotionFX/Code/Tests/TestAssets/Rin/rin_idle.motion");
return QString::fromUtf8(resolvedAssetPath.data(), aznumeric_cast<int>(resolvedAssetPath.size()));
}
@@ -59,7 +59,7 @@ The API:
- ExecuteByString(string) runs a string buffer in the Python VM; it returns no value
- ExecuteByFilename(string) loads a file off of the disk to execute in the
Python VM; the call returns no value. The filename can contain an alias such as
\@devroot\@ to execute a project relative file inside the Editor
\@projectroot\@ to execute a project relative file inside the Editor
#### New Console Commands
@@ -38,7 +38,7 @@ namespace EditorPythonBindings
static constexpr const char* s_default = "default";
static constexpr const char* s_globals = "globals";
// a structure for pybind11 to bind to hold constants, properties, and enums from the Behavior Context
// a structure for pybind11 to bind to hold constants, properties, and enums from the Behavior Context
struct StaticPropertyHolder final
{
AZ_CLASS_ALLOCATOR(StaticPropertyHolder, AZ::SystemAllocator, 0);
@@ -54,7 +54,7 @@ namespace EditorPythonBindings
if (m_behaviorContext == nullptr)
{
return false;
}
}
m_fullName = PyModule_GetName(scope.ptr());
@@ -199,12 +199,10 @@ namespace EditorPythonBindings
}
});
RegisterAliasIfExists(pathsModule, "@devroot@", "devroot");
RegisterAliasIfExists(pathsModule, "@engroot@", "engroot");
RegisterAliasIfExists(pathsModule, "@assets@", "assets");
RegisterAliasIfExists(pathsModule, "@devassets@", "devassets");
RegisterAliasIfExists(pathsModule, "@products@", "products");
RegisterAliasIfExists(pathsModule, "@projectroot@", "projectroot");
RegisterAliasIfExists(pathsModule, "@log@", "log");
RegisterAliasIfExists(pathsModule, "@root@", "root");
const char* executableFolder = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(executableFolder, &AZ::ComponentApplicationBus::Events::GetExecutableFolder);
@@ -363,7 +361,7 @@ namespace EditorPythonBindings
m_staticPropertyHolderMap.reset();
EditorPythonBindings::EditorPythonBindingsNotificationBus::Handler::BusDisconnect();
}
void PythonReflectionComponent::OnImportModule(PyObject* module)
{
pybind11::module parentModule = pybind11::cast<pybind11::module>(module);
@@ -524,7 +524,7 @@ namespace EditorPythonBindings
{
AZ::IO::Path newSourcePath = jsonSourcePathPointer;
// Resolve any file aliases first - Do not use ResolvePath() as that assumes
// any relative path is underneath the @assets@ alias
// any relative path is underneath the @products@ alias
if (auto fileIoBase = AZ::IO::FileIOBase::GetInstance(); fileIoBase != nullptr)
{
AZ::IO::FixedMaxPath replacedAliasPath;
@@ -803,7 +803,7 @@ namespace EditorPythonBindings
return Result::Error_InvalidFilename;
}
// support the alias version of a script such as @devroot@/Editor/Scripts/select_story_anim_objects.py
// support the alias version of a script such as @engroot@/Editor/Scripts/select_story_anim_objects.py
AZStd::string theFilename(filename);
{
char resolvedPath[AZ_MAX_PATH_LEN] = { 0 };
@@ -268,7 +268,7 @@ print ('entityId invalid is ' + str(entityId.id))
{
Skip = 0,
ImportModule,
TestCallHit,
TestCallHit,
TestTypeDoCall1
};
@@ -302,7 +302,7 @@ print ('entityId invalid is ' + str(entityId.id))
pybind11::exec(R"(
import sys, os
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot,'Gems','EditorPythonBindings','Code','Tests'))
sys.path.append(os.path.join(azlmbr.paths.engroot,'Gems','EditorPythonBindings','Code','Tests'))
from test_package import import_test as itest
print('ImportModule')
itest.test_call()
@@ -401,8 +401,8 @@ print ('entityId invalid is ' + str(entityId.id))
pybind11::exec(R"(
import sys, os
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot,'Gems','EditorPythonBindings','Code','Tests'))
sys.path.append(os.path.join(azlmbr.paths.devroot,'Gems','EditorPythonBindings','Code','Tests','test_package'))
sys.path.append(os.path.join(azlmbr.paths.engroot,'Gems','EditorPythonBindings','Code','Tests'))
sys.path.append(os.path.join(azlmbr.paths.engroot,'Gems','EditorPythonBindings','Code','Tests','test_package'))
from test_package import import_many
import_many.test_many_entity_id()
@@ -161,7 +161,7 @@ namespace UnitTest
->Method("accept_vector_of_floats", &PythonReflectionContainerSimpleTypes::AcceptVectorOfFloats, nullptr, "")
->Method("return_vector_of_doubles", &PythonReflectionContainerSimpleTypes::ReturnVectorOfDoubles, nullptr, "")
->Method("accept_vector_of_doubles", &PythonReflectionContainerSimpleTypes::AcceptVectorOfDoubles, nullptr, "")
->Property("vector_of_s8",
->Property("vector_of_s8",
[](PythonReflectionContainerSimpleTypes* self) { return self->m_s8ValueValues.ReturnValues(); },
[](PythonReflectionContainerSimpleTypes* self, const AZStd::vector<AZ::s8>& values) { return self->m_s8ValueValues.AcceptValues(values); })
->Property("vector_of_u8",
@@ -792,7 +792,7 @@ namespace UnitTest
theAsset = reflectAny.access_any_ref()
if( reflectAny.compare_asset_ids(theAsset,testObject.theAsset) ):
print ('MutateAssetId')
)");
}
catch ([[maybe_unused]] const std::exception& e)
@@ -1429,7 +1429,6 @@ namespace UnitTest
{
Skip = 0,
EngrootIs,
DevrootIs,
pathResolvedTo,
};
@@ -1442,10 +1441,6 @@ namespace UnitTest
{
return static_cast<int>(LogTypes::EngrootIs);
}
else if (AzFramework::StringFunc::StartsWith(message, "devroot is "))
{
return static_cast<int>(LogTypes::DevrootIs);
}
else if (AzFramework::StringFunc::StartsWith(message, "path resolved to "))
{
return static_cast<int>(LogTypes::pathResolvedTo);
@@ -1470,9 +1465,6 @@ namespace UnitTest
if (len(azlmbr.paths.engroot) != 0):
print ('engroot is {}'.format(azlmbr.paths.engroot))
if (len(azlmbr.paths.devroot) != 0):
print ('devroot is {}'.format(azlmbr.paths.devroot))
path = azlmbr.paths.resolve_path('@engroot@/engineassets/texturemsg/defaultsolids.mtl')
if (path.find('@engroot@') == -1):
print ('path resolved to {}'.format(path))
@@ -1487,7 +1479,6 @@ namespace UnitTest
e.Deactivate();
EXPECT_EQ(m_testSink.m_evaluationMap[(int)LogTypes::EngrootIs], 1);
EXPECT_EQ(m_testSink.m_evaluationMap[(int)LogTypes::DevrootIs], 1);
EXPECT_EQ(m_testSink.m_evaluationMap[(int)LogTypes::pathResolvedTo], 1);
}
}
@@ -81,7 +81,6 @@ namespace UnitTest
}
m_fileIOHelper = AZStd::make_unique<FileIOHelper>();
m_fileIOHelper->m_fileIO.SetAlias("@devroot@", m_engineRoot.c_str());
m_fileIOHelper->m_fileIO.SetAlias("@engroot@", m_engineRoot.c_str());
AzFramework::Application::Descriptor appDesc;
@@ -27,7 +27,7 @@ namespace GameStateSamples
IConsole* iConsole = iSystem ? iSystem->GetIConsole() : nullptr;
if (iConsole)
{
iConsole->GetCVar("level_load_screen_uicanvas_path")->Set("@assets@/ui/canvases/defaultlevelloadingscreen.uicanvas");
iConsole->GetCVar("level_load_screen_uicanvas_path")->Set("@products@/ui/canvases/defaultlevelloadingscreen.uicanvas");
iConsole->GetCVar("level_load_screen_sequence_to_auto_play")->Set("DefaultLevelLoadingAnimatedSequence");
}
}
@@ -182,7 +182,7 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStateLevelPaused::GetPauseMenuCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultpausemenuscreen.uicanvas";
return "@products@/ui/canvases/defaultpausemenuscreen.uicanvas";
}
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -206,6 +206,6 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStateLevelRunning::GetPauseButtonCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultpausebuttonfortouchscreens.uicanvas";
return "@products@/ui/canvases/defaultpausebuttonfortouchscreens.uicanvas";
}
}
@@ -223,7 +223,7 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStateLocalUserLobby::GetSignedInUserOverlayCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultsignedinusersoverlay.uicanvas";
return "@products@/ui/canvases/defaultsignedinusersoverlay.uicanvas";
}
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -282,7 +282,7 @@ namespace GameStateSamples
}
// ...sort them by index and then go through to check whether they have been
// assigned a local user id. If so, auto-assign their local user id into the
// assigned a local user id. If so, auto-assign their local user id into the
// first available local player slot (unless they've already been assigned).
AZStd::sort(gamepadInputDevices.begin(), gamepadInputDevices.end(),
[](const AzFramework::InputDevice* lhs, const AzFramework::InputDevice* rhs)
@@ -257,7 +257,7 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStateMainMenu::GetMainMenuCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultmainmenuscreen.uicanvas";
return "@products@/ui/canvases/defaultmainmenuscreen.uicanvas";
}
@@ -215,7 +215,7 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStateOptionsMenu::GetOptionsMenuCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultoptionsmenuscreen.uicanvas";
return "@products@/ui/canvases/defaultoptionsmenuscreen.uicanvas";
}
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -168,6 +168,6 @@ namespace GameStateSamples
////////////////////////////////////////////////////////////////////////////////////////////////
inline const char* GameStatePrimaryUserSelection::GetPrimaryUserSelectionCanvasAssetPath()
{
return "@assets@/ui/canvases/defaultprimaryuserselectionscreen.uicanvas";
return "@products@/ui/canvases/defaultprimaryuserselectionscreen.uicanvas";
}
}
@@ -74,10 +74,10 @@ namespace
m_paletteSwatches.push_back(QColor(0, 0, 0));
m_sourcePixmap = new QPixmap(16, 16);
m_sourcePixmap->fill(Qt::transparent);
QPainter painter(m_sourcePixmap);
painter.setRenderHint(QPainter::RenderHint::Antialiasing);
QPen pen;
pen.setWidth(4);
pen.setColor(QColor(0, 0, 0));
@@ -257,7 +257,7 @@ namespace GraphCanvas
QBitmap mask = m_sourcePixmap->createMaskFromColor(m_paletteSwatches[i], Qt::MaskOutColor);
painter.setClipRegion(QRegion(mask));
QtDrawingUtils::FillArea(painter, drawRect, (*palettes[i%palettes.size()]));
QtDrawingUtils::FillArea(painter, drawRect, (*palettes[i%palettes.size()]));
}
return pixmap;
@@ -317,7 +317,7 @@ namespace GraphCanvas
void StyleManager::LoadStyleSheet()
{
AZStd::string file = AZStd::string::format("@assets@/%s", m_assetPath.c_str());
AZStd::string file = AZStd::string::format("@products@/%s", m_assetPath.c_str());
AZ::IO::FileIOBase* fileBase = AZ::IO::FileIOBase::GetInstance();
@@ -448,7 +448,7 @@ namespace GraphCanvas
auto mapIter = m_dataPaletteMapping.find(dataType);
if (mapIter == m_dataPaletteMapping.end())
{
{
return "ObjectDataColorPalette";
}
else
@@ -852,7 +852,7 @@ namespace GraphCanvas
return icon;
}
void StyleManager::ClearStyles()
{
StyleManagerNotificationBus::Event(m_editorId, &StyleManagerNotifications::OnStylesUnloaded);
@@ -58,7 +58,7 @@ namespace InAppPurchases
}
PurchasedProductDetailsAndroid* purchasedProductDetails = new PurchasedProductDetailsAndroid();
purchasedProductDetails->SetProductId(AZ::Android::JNI::ConvertJstringToString(static_cast<jstring>(env->GetObjectField(jpurchasedProduct, fid[0]))));
purchasedProductDetails->SetOrderId(AZ::Android::JNI::ConvertJstringToString(static_cast<jstring>(env->GetObjectField(jpurchasedProduct, fid[1]))));
purchasedProductDetails->SetPackageName(AZ::Android::JNI::ConvertJstringToString(static_cast<jstring>(env->GetObjectField(jpurchasedProduct, fid[2]))));
@@ -75,7 +75,7 @@ namespace InAppPurchases
int numProducts = env->GetArrayLength(jproductDetails);
InAppPurchasesInterface::GetInstance()->GetCache()->ClearCachedProductDetails();
const int NUM_FIELDS_PRODUCTS = 7;
jfieldID fid[NUM_FIELDS_PRODUCTS];
jclass cls;
@@ -224,7 +224,7 @@ namespace InAppPurchases
AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle;
AZ::u64 fileSize = 0;
if (!fileReader->Open("@assets@/product_ids.json", AZ::IO::OpenMode::ModeRead, fileHandle))
if (!fileReader->Open("@products@/product_ids.json", AZ::IO::OpenMode::ModeRead, fileHandle))
{
AZ_TracePrintf("LumberyardInAppBilling", "Unable to open file product_ids.json\n");
return;
@@ -319,10 +319,10 @@ namespace InAppPurchases
env->DeleteLocalRef(billingClass);
}
void InAppPurchasesAndroid::RestorePurchasedProducts() const
{
}
void InAppPurchasesAndroid::ConsumePurchase(const AZStd::string& purchaseToken) const
@@ -63,13 +63,13 @@ namespace CopyDependencyBuilder
charBuffer.back() = 0;
/* File Contents of EMFX Workspace file looks like
startScript="ImportActor -filename \"@assets@/animationsamples/advanced_rinlocomotion/actor/rinactor.actor\"\nCreateActorInstance
startScript="ImportActor -filename \"@products@/animationsamples/advanced_rinlocomotion/actor/rinactor.actor\"\nCreateActorInstance
-actorID %LASTRESULT% -xPos 0.000000 -yPos 0.020660 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,
0.00000000,0.00000000,0.99997193\n LoadMotionSet -filename \"@assets@/AnimationSamples/Advanced_RinLocomotion/AnimationEditorFiles/Advanced_RinLocomotion.motionset\"
\nLoadAnimGraph -filename \"@assets@/AnimationSamples/Advanced_RinLocomotion/AnimationEditorFiles/Advanced_RinLocomotion.animgraph\"
0.00000000,0.00000000,0.99997193\n LoadMotionSet -filename \"@products@/AnimationSamples/Advanced_RinLocomotion/AnimationEditorFiles/Advanced_RinLocomotion.motionset\"
\nLoadAnimGraph -filename \"@products@/AnimationSamples/Advanced_RinLocomotion/AnimationEditorFiles/Advanced_RinLocomotion.animgraph\"
\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n"
*/
AZStd::regex pathRegex(R"(\s+-filename\s+\\\"(?:@assets@\/)?(\S+)\\\")");
AZStd::regex pathRegex(R"(\s+-filename\s+\\\"(?:@products@\/)?(\S+)\\\")");
AZStd::smatch matches;
AZStd::string::const_iterator searchStart = charBuffer.begin();
while (AZStd::regex_search(searchStart, matches, pathRegex))
@@ -30,7 +30,7 @@
namespace LevelBuilder
{
const char s_materialExtension[] = ".mtl";
const char s_audioControlFilesLevelPath[] = "@devassets@/libs/gameaudio/wwise/levels/%s";
const char s_audioControlFilesLevelPath[] = "@projectroot@/libs/gameaudio/wwise/levels/%s";
const char s_audioControlFilter[] = "*.xml";
AZ::u64 readXmlDataLength(AZ::IO::GenericStream* stream, int& charSize)
@@ -28,7 +28,7 @@ namespace MaterialBuilder
const char g_nodeNameTexture[] = "Texture";
const char g_nodeNameTextures[] = "Textures";
const char g_attributeFileName[] = "File";
const int g_numSourceImageFormats = 9;
const char* g_sourceImageFormats[g_numSourceImageFormats] = { ".tif", ".tiff", ".bmp", ".gif", ".jpg", ".jpeg", ".tga", ".png", ".dds" };
bool IsSupportedImageExtension(const AZStd::string& extension)
@@ -66,7 +66,7 @@ namespace MaterialBuilder
return actualFileName;
}
// Parses the material XML for all texture paths
// Parses the material XML for all texture paths
AZ::Outcome<AZStd::string, AZStd::string> GetTexturePathsFromMaterial(AZ::rapidxml::xml_node<char>* materialNode, AZStd::vector<AZStd::string>& paths)
{
AZ::Outcome<AZStd::string, AZStd::string> resultOutcome = AZ::Failure(AZStd::string(""));
@@ -94,7 +94,7 @@ namespace MaterialBuilder
// do an initial clean-up of the path taken from the file, similar to MaterialHelpers::SetTexturesFromXml
AZStd::string texturePath = CleanLegacyPathingFromTexturePath(rawTexturePath);
paths.emplace_back(AZStd::move(texturePath));
}
}
textureNode = textureNode->next_sibling(g_nodeNameTexture);
} while (textureNode);
@@ -112,7 +112,7 @@ namespace MaterialBuilder
return AZ::Failure(AZStd::string("SubMaterials node exists but does not have any child Material nodes."));
}
do
do
{
// grab the texture paths from the submaterial, or error out if necessary
AZ::Outcome<AZStd::string, AZStd::string> subMaterialTexturePathsResult = GetTexturePathsFromMaterial(subMaterialNode, paths);
@@ -142,7 +142,7 @@ namespace MaterialBuilder
}
// find a sequence of digits with a string starting from lastDigitIndex, and try to parse that sequence to and int
// and store it in outAnimIndex.
// and store it in outAnimIndex.
bool ParseFilePathForCompleteNumber(const AZStd::string& filePath, int& lastDigitIndex, int& outAnimIndex)
{
int firstAnimIndexDigit = lastDigitIndex;
@@ -162,7 +162,7 @@ namespace MaterialBuilder
AZ::Outcome<void, AZStd::string> GetAllTexturesInTextureSequence(const AZStd::string& path, AZStd::vector<AZStd::string>& texturesInSequence)
{
// Taken from CShaderMan::mfReadTexSequence
// All comments next to variable declarations in this function are the original variable names in
// All comments next to variable declarations in this function are the original variable names in
// CShaderMan::mfReadTexSequence, to help keep track of how these variables relate to the original function
AZStd::string prefix;
AZStd::string postfix;
@@ -172,7 +172,7 @@ namespace MaterialBuilder
AzFramework::StringFunc::Path::GetExtension(filePath.c_str(), extension);
AzFramework::StringFunc::Path::StripExtension(filePath);
// unsure if it is actually possible to enter here or the original version with '$' as the indicator
// unsure if it is actually possible to enter here or the original version with '$' as the indicator
// for texture sequences, but they check for both just in case, so this will match the behavior.
char separator = '#'; // chSep
int firstSeparatorIndex = static_cast<int>(filePath.find(separator));
@@ -186,7 +186,7 @@ namespace MaterialBuilder
separator = '$';
}
// we don't actually care about getting the speed of the animation, so just remove everything from the
// we don't actually care about getting the speed of the animation, so just remove everything from the
// end of the string starting with the last open parenthesis
size_t speedStartIndex = filePath.find_last_of('(');
if (speedStartIndex != AZStd::string::npos)
@@ -195,7 +195,7 @@ namespace MaterialBuilder
AzFramework::StringFunc::Append(filePath, '\0');
}
// try to find where the digits start after the separator (there can be any number of separators
// try to find where the digits start after the separator (there can be any number of separators
// between the texture name prefix and where the digit range starts)
int firstAnimIndexDigit = -1; // m
int numSeparators = 0; // j
@@ -219,7 +219,7 @@ namespace MaterialBuilder
{
return AZ::Failure(AZStd::string("Failed to find separator '#' or '$' in texture path."));
}
// store off everything before the separator
prefix = AZStd::move(filePath.substr(0, firstSeparatorIndex));
@@ -242,7 +242,7 @@ namespace MaterialBuilder
// reset to the start of the next index
++lastDigitIndex;
// find the length of the end index, then parse that to an int
if (!ParseFilePathForCompleteNumber(filePath, lastDigitIndex, endAnimIndex))
{
@@ -262,8 +262,8 @@ namespace MaterialBuilder
return AZ::Success();
}
// Determine which product path to use based on the path stored in the texture, and make it relative to
// Determine which product path to use based on the path stored in the texture, and make it relative to
// the cache.
bool ResolveMaterialTexturePath(const AZStd::string& path, AZStd::string& outPath)
{
@@ -272,7 +272,7 @@ namespace MaterialBuilder
//if its a source image format try to load the dds
AZStd::string extension;
bool hasExtension = AzFramework::StringFunc::Path::GetExtension(path.c_str(), extension);
// Replace all supported extensions with DDS if it has an extension. If the extension exists but is not supported, fail out.
if (hasExtension && IsSupportedImageExtension(extension))
{
@@ -286,17 +286,17 @@ namespace MaterialBuilder
AZStd::to_lower(aliasedPath.begin(), aliasedPath.end());
AzFramework::StringFunc::Path::Normalize(aliasedPath);
AZStd::string currentFolderSpecifier = AZStd::string::format(".%c", AZ_CORRECT_FILESYSTEM_SEPARATOR);
if (AzFramework::StringFunc::StartsWith(aliasedPath, currentFolderSpecifier))
{
AzFramework::StringFunc::Strip(aliasedPath, currentFolderSpecifier.c_str(), false, true);
}
AZStd::string resolvedPath;
char fullPathBuffer[AZ_MAX_PATH_LEN] = {};
// if there is an alias already at the front of the path, resolve it, and try to make it relative to the
// cache (@assets@). If it can't, then error out.
// if there is an alias already at the front of the path, resolve it, and try to make it relative to the
// cache (@products@). If it can't, then error out.
// This case handles the possibility of aliases existing in texture paths in materials that is still supported
// by the legacy loading code, however it is not currently used, so the else path is always taken.
if (aliasedPath[0] == '@')
@@ -308,7 +308,7 @@ namespace MaterialBuilder
}
resolvedPath = fullPathBuffer;
AzFramework::StringFunc::Path::Normalize(resolvedPath);
if (!AzFramework::StringFunc::Replace(resolvedPath, AZ::IO::FileIOBase::GetDirectInstance()->GetAlias("@assets@"), ""))
if (!AzFramework::StringFunc::Replace(resolvedPath, AZ::IO::FileIOBase::GetDirectInstance()->GetAlias("@products@"), ""))
{
AZ_Warning(s_materialBuilder, false, "Failed to resolve aliased texture path %s to be relative to the asset cache. Please make sure this alias resolves to a path within the asset cache.", aliasedPath.c_str());
return false;
@@ -318,7 +318,7 @@ namespace MaterialBuilder
{
resolvedPath = AZStd::move(aliasedPath);
}
// AP deferred path resolution requires UNIX separators and no leading separators, so clean up and convert here
if (AzFramework::StringFunc::StartsWith(resolvedPath, AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING))
{
@@ -357,7 +357,7 @@ namespace MaterialBuilder
// (optimization) this builder does not emit source dependencies:
builderDescriptor.m_flags |= AssetBuilderSDK::AssetBuilderDesc::BF_EmitsNoDependencies;
m_materialBuilder.BusConnect(builderDescriptor.m_busId);
EBUS_EVENT(AssetBuilderSDK::AssetBuilderBus, RegisterBuilderInformation, builderDescriptor);
@@ -548,10 +548,10 @@ namespace MaterialBuilder
}
}
// for each texture in the file
// for each texture in the file
for (const AZStd::string& texPath : texturePaths)
{
// if the texture path starts with a '$' then it is a special runtime defined texture, so it it doesn't have
// if the texture path starts with a '$' then it is a special runtime defined texture, so it it doesn't have
// an actual asset on disk to depend on. If the texture path doesn't have an extension, then it is a texture
// that is determined at runtime (such as 'nearest_cubemap'), so also ignore those, as other things pull in
// those dependencies.
@@ -567,7 +567,7 @@ namespace MaterialBuilder
AZ_Warning(s_materialBuilder, false, "Failed to resolve texture path %s to a product path when gathering dependencies for %s. Registering dependencies on this texture path will be skipped.", texPath.c_str(), path.c_str());
continue;
}
resolvedPaths.emplace_back(AZStd::move(resolvedPath));
}
@@ -22,7 +22,7 @@
namespace LmbrCentral
{
const char bundleRoot[] = "@assets@";
const char bundleRoot[] = "@products@";
void BundlingSystemComponent::Activate()
{
@@ -178,7 +178,7 @@ namespace LmbrCentral
// Not already opened, new entry
m_openedBundles[bundleName] = AZStd::make_unique<OpenBundleInfo>();
AZStd::shared_ptr<AzFramework::AssetRegistry> nextCatalog; // Not all bundles will have catalogs - some are legacy.
AZStd::shared_ptr<AzFramework::AssetRegistry> nextCatalog; // Not all bundles will have catalogs - some are legacy.
if (nextBundle == nullptr)
{
// Added to the end
+1 -1
View File
@@ -484,7 +484,7 @@ namespace LmbrCentral
}
// load the catalog from disk (supported over VFS).
EBUS_EVENT(AZ::Data::AssetCatalogRequestBus, LoadCatalog, AZStd::string::format("@assets@/%s", s_assetCatalogFilename).c_str());
EBUS_EVENT(AZ::Data::AssetCatalogRequestBus, LoadCatalog, AZStd::string::format("@products@/%s", s_assetCatalogFilename).c_str());
}
void LmbrCentralSystemComponent::OnCrySystemShutdown([[maybe_unused]] ISystem& system)
@@ -69,7 +69,7 @@ namespace UnitTest
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
SerializeContext* serializeContext;
ComponentApplicationBus::BroadcastResult(serializeContext, &ComponentApplicationRequests::GetSerializeContext);
@@ -114,7 +114,7 @@ namespace UnitTest
{
AssetBuilderSDK::ProductPathDependencySet resolvedPaths;
AZStd::vector<AssetBuilderSDK::ProductDependency> productDependencies;
AssetBuilderSDK::ProcessJobRequest request;
request.m_fullPath = GetFullPath(fileName);
request.m_sourceFile = fileName;
@@ -211,8 +211,6 @@ namespace UnitTest
//////////////////////////////////////////////////////////////////////////
// AzToolsFramework::AssetSystem::AssetSystemRequestBus::Handler overrides
const char* GetAbsoluteDevGameFolderPath() override { return ""; }
const char* GetAbsoluteDevRootFolderPath() override { return ""; }
bool GetRelativeProductPathFromFullSourceOrProductPath([[maybe_unused]] const AZStd::string& fullPath, [[maybe_unused]] AZStd::string& relativeProductPath) override { return true; }
bool GenerateRelativeSourcePath(
[[maybe_unused]] const AZStd::string& sourcePath, [[maybe_unused]] AZStd::string& relativePath,
@@ -428,7 +426,7 @@ namespace UnitTest
"Fonts/fontexample-bolditalic.font"
};
AZStd::string fileName = "Fonts/FontFamilyExample.fontfamily";
AZStd::string fileName = "Fonts/FontFamilyExample.fontfamily";
FontBuilderWorker builderWorker;
@@ -445,7 +443,7 @@ namespace UnitTest
AZStd::string fileName = "Fonts/FontExample.font";
FontBuilderWorker builderWorker;
TestSuccessCase(&builderWorker, fileName, "Fonts/FontExample.ttf");
}
@@ -667,7 +665,7 @@ namespace UnitTest
builderWorker.AddSchemaFileDirectory(GetFullPath("Xmls/Schema/WithoutVersionConstraints/OptionalAttribute"));
AZStd::vector<AssetBuilderSDK::ProductDependency> expectedProductDependencies;
TestSuccessCase(&builderWorker, fileName, expectedPaths, expectedProductDependencies);
}
@@ -896,7 +894,7 @@ namespace UnitTest
AssetBuilderSDK::CreateJobsResponse response;
request.m_sourceFile = "Tests/Xmls/XmlExampleWithoutVersion.xml";
request.m_watchFolder = "@root@/../Gems/LmbrCentral/Code/";
request.m_watchFolder = "@engroot@/Gems/LmbrCentral/Code/";
XmlBuilderWorker builderWorker;
builderWorker.AddSchemaFileDirectory(GetFullPath("Xmls/Schema/WithoutVersionConstraints/FullFeatured"));
@@ -104,7 +104,7 @@ namespace UnitTest
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
AZ::Debug::TraceMessageBus::Handler::BusConnect();
@@ -114,7 +114,7 @@ namespace UnitTest
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
auto* serializeContext = m_app.GetSerializeContext();
@@ -142,7 +142,7 @@ namespace UnitTest
AZStd::string GetTestFileAliasedPath(AZStd::string_view fileName)
{
constexpr char testFileFolder[] = "@devroot@/Gems/LmbrCentral/Code/Tests/Levels/";
constexpr char testFileFolder[] = "@engroot@/Gems/LmbrCentral/Code/Tests/Levels/";
return AZStd::string::format("%s%.*s", testFileFolder, aznumeric_cast<int>(fileName.size()), fileName.data());
}
@@ -36,7 +36,7 @@ namespace UnitTest
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
@@ -45,7 +45,7 @@ namespace UnitTest
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
}
void TearDown() override
@@ -35,7 +35,7 @@ namespace UnitTest
m_app.reset(aznew AzToolsFramework::ToolsApplication);
m_app->Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
AZ::Debug::TraceMessageBus::Handler::BusConnect();
@@ -45,8 +45,7 @@ namespace UnitTest
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@assets@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
}
void TearDown() override
@@ -128,8 +127,8 @@ namespace UnitTest
TEST_F(MaterialBuilderTests, MaterialBuilder_MalformedMaterial_NoChildren_ExpectFailure)
{
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Internal::GetTexturePathsFromMaterial, which should return an AZ::Failure when both a Textures node and a
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Internal::GetTexturePathsFromMaterial, which should return an AZ::Failure when both a Textures node and a
// SubMaterials node are not found. No other AZ_Errors should be generated.
TestFailureCase("test_mat2.mtl", 1);
}
@@ -141,7 +140,7 @@ namespace UnitTest
TEST_F(MaterialBuilderTests, MaterialBuilder_MalformedMaterial_EmptySubMaterialNode_ExpectFailure)
{
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Internal::GetTexturePathsFromMaterial, which should return an AZ::Failure when a SubMaterials node is present,
// but has no children Material node. No other AZ_Errors should be generated.
TestFailureCase("test_mat4.mtl", 1);
@@ -154,9 +153,9 @@ namespace UnitTest
TEST_F(MaterialBuilderTests, MaterialBuilder_MalformedMaterial_EmptyMaterialInSubMaterial_ExpectFailure)
{
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Should fail in MaterialBuilderWorker::GetResolvedTexturePathsFromMaterial after calling
// Internal::GetTexturePathsFromMaterial, which should return an AZ::Failure when a SubMaterials node is present,
// but a child Material node has no child Textures node and no child SubMaterials node. No other AZ_Errors should
// but a child Material node has no child Textures node and no child SubMaterials node. No other AZ_Errors should
// be generated.
TestFailureCase("test_mat6.mtl", 1);
}
@@ -235,7 +234,7 @@ namespace UnitTest
AZStd::vector<const char*> expectedPaths = {
"engineassets/textures/hex.dds", // resolved from "/engineassets/textures/hex.dds"
"engineassets/textures/hex_ddn.dds", // resolved from "./engineassets/textures/hex_ddn.dds"
"engineassets/textures/hex_spec.dds" // resolved from "@assets@/engineassets/textures/hex_spec.dds"
"engineassets/textures/hex_spec.dds" // resolved from "@products@/engineassets/textures/hex_spec.dds"
};
TestSuccessCase("test_mat17.mtl", expectedPaths);
}
@@ -24,16 +24,16 @@ class SeedBuilderTests
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
const char* dir = m_app.GetExecutableFolder();
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", dir);
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", dir);
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
}
@@ -49,7 +49,7 @@ TEST_F(SeedBuilderTests, SeedBuilder_SourceDependency_Valid)
{
DependencyBuilder::SeedBuilderWorker seedBuilderWorker;
AssetBuilderSDK::CreateJobsRequest request;
constexpr char testSeedFolder[] = "@root@/../Gems/LmbrCentral/Code/Tests/Seed";
constexpr char testSeedFolder[] = "@engroot@/Gems/LmbrCentral/Code/Tests/Seed";
char resolvedPath[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath(testSeedFolder, resolvedPath, AZ_MAX_PATH_LEN);
request.m_watchFolder = resolvedPath;
@@ -78,7 +78,7 @@ TEST_F(SeedBuilderTests, SeedBuilder_EmptySourceDependency_Valid)
{
DependencyBuilder::SeedBuilderWorker seedBuilderWorker;
AssetBuilderSDK::CreateJobsRequest request;
constexpr char testSeedFolder[] = "@root@/../Gems/LmbrCentral/Code/Tests/Seed";
constexpr char testSeedFolder[] = "@engroot@/Gems/LmbrCentral/Code/Tests/Seed";
char resolvedPath[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath(testSeedFolder, resolvedPath, AZ_MAX_PATH_LEN);
request.m_watchFolder = resolvedPath;
@@ -52,7 +52,7 @@ namespace UnitTest
{
return false;
}
AZ::Data::AssetInfo assetInfo;
AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, testAssetId);
return assetInfo.m_relativePath == assetPath;
@@ -61,7 +61,7 @@ namespace UnitTest
TEST_F(Integ_BundlingSystemComponentFixture, HasBundle_LoadBundles_Success)
{
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// cache as test/bundle/staticdata.pak and should be loaded below
const char testAssetPath[] = "staticdata/csv/bundlingsystemtestgameproperties.csv";
@@ -74,7 +74,7 @@ namespace UnitTest
TEST_F(Integ_BundlingSystemComponentFixture, HasBundle_LoadBundlesCatalogChecks_Success)
{
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// cache as test/bundle/staticdata.pak and should be loaded below
// The Pak has a catalog describing the contents which should automatically update our central asset catalog
const char testAssetPath[] = "staticdata/csv/bundlingsystemtestgameproperties.csv";
@@ -94,34 +94,34 @@ namespace UnitTest
TEST_F(Integ_BundlingSystemComponentFixture, BundleSystemComponent_SingleUnloadCheckCatalog_Success)
{
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// cache as test/bundle/staticdata.pak and should be loaded below
// The Pak has a catalog describing the contents which should automatically update our central asset catalog
const char testCSVAsset[] = "staticdata/csv/bundlingsystemtestgameproperties.csv";
const char testCSVAssetPak[] = "test/bundle/staticdata.pak";
// This asset lives only within LmbrCentral/Assets/Test/Bundle/ping.pak
// This asset lives only within LmbrCentral/Assets/Test/Bundle/ping.pak
const char testDDSAsset[] = "textures/test/ping.dds";
const char testDDSAssetPak[] = "test/bundle/ping.pak";
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_FALSE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_TRUE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testDDSAssetPak));
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_FALSE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testCSVAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testCSVAssetPak));
EXPECT_TRUE(TestAssetId(testCSVAsset));
EXPECT_FALSE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
EXPECT_TRUE(TestAssetId(testCSVAsset));
EXPECT_TRUE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testDDSAssetPak));
EXPECT_TRUE(TestAssetId(testCSVAsset));
EXPECT_FALSE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
EXPECT_TRUE(TestAssetId(testCSVAsset));
EXPECT_TRUE(TestAssetId(testDDSAsset));
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testCSVAssetPak));
@@ -134,7 +134,7 @@ namespace UnitTest
TEST_F(Integ_BundlingSystemComponentFixture, BundleSystemComponent_SingleLoadAndBundleMode_Success)
{
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// cache as test/bundle/staticdata.pak and should be loaded below
// The Pak has a catalog describing the contents which should automatically update our central asset catalog
const char testCSVAsset[] = "staticdata/csv/bundlingsystemtestgameproperties.csv";
@@ -143,7 +143,7 @@ namespace UnitTest
const char testMTLAssetPak[] = "test/TestMaterials.pak";
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_FALSE(TestAssetId(testMTLAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testMTLAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testMTLAssetPak));
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_TRUE(TestAssetId(testMTLAsset));
LmbrCentral::BundlingSystemRequestBus::Broadcast(&LmbrCentral::BundlingSystemRequestBus::Events::LoadBundles, "test/bundle", ".pak");
@@ -159,35 +159,35 @@ namespace UnitTest
TEST_F(Integ_BundlingSystemComponentFixture, BundleSystemComponent_OpenClosePackCount_Match)
{
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// This asset lives only within LmbrCentral/Assets/Test/Bundle/staticdata.pak which is copied to our
// cache as test/bundle/staticdata.pak and should be loaded below
// The Pak has a catalog describing the contents which should automatically update our central asset catalog
const char testCSVAsset[] = "staticdata/csv/bundlingsystemtestgameproperties.csv";
const char testCSVAssetPak[] = "test/bundle/staticdata.pak";
// This asset lives only within LmbrCentral/Assets/Test/Bundle/ping.pak
// This asset lives only within LmbrCentral/Assets/Test/Bundle/ping.pak
const char testDDSAssetPak[] = "test/bundle/ping.pak";
size_t bundleCount{ 0 };
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount,&LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 0);
EXPECT_FALSE(TestAssetId(testCSVAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 1);
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 0);
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testCSVAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testCSVAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 1);
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 2);
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 1);
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 2);
EXPECT_TRUE(gEnv->pCryPak->ClosePack(testCSVAssetPak));
@@ -208,7 +208,7 @@ namespace UnitTest
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 0);
EXPECT_FALSE(TestAssetId(testDDSAsset_split));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 2);
EXPECT_TRUE(TestAssetId(testDDSAsset_split));
@@ -217,7 +217,7 @@ namespace UnitTest
EXPECT_EQ(bundleCount, 0);
EXPECT_FALSE(TestAssetId(testDDSAsset_split));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testDDSAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testDDSAssetPak));
LmbrCentral::BundlingSystemRequestBus::BroadcastResult(bundleCount, &LmbrCentral::BundlingSystemRequestBus::Events::GetOpenedBundleCount);
EXPECT_EQ(bundleCount, 2);
EXPECT_TRUE(TestAssetId(testDDSAsset_split));
@@ -240,7 +240,7 @@ namespace UnitTest
EXPECT_FALSE(TestAssetId(testGamePropertiesAsset));
EXPECT_FALSE(TestAssetId(testUserRequestAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testGamePropertiesAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testGamePropertiesAssetPak));
EXPECT_TRUE(TestAssetId(testGamePropertiesAsset));
EXPECT_FALSE(TestAssetId(testUserRequestAsset));
AZ::Data::AssetId testAssetId;
@@ -253,7 +253,7 @@ namespace UnitTest
EXPECT_NE(assetInfo.m_sizeBytes, 0);
AZ::u64 assetSize1 = assetInfo.m_sizeBytes;
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testUserRequestAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testUserRequestAssetPak));
EXPECT_TRUE(TestAssetId(testGamePropertiesAsset));
EXPECT_TRUE(TestAssetId(testUserRequestAsset));
@@ -271,13 +271,13 @@ namespace UnitTest
EXPECT_FALSE(TestAssetId(testGamePropertiesAsset));
EXPECT_FALSE(TestAssetId(testUserRequestAsset));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testUserRequestAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testUserRequestAssetPak));
AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, testAssetId);
AZ::u64 assetSize3 = assetInfo.m_sizeBytes;
EXPECT_EQ(assetSize3, assetSize2);
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@assets@", testGamePropertiesAssetPak));
EXPECT_TRUE(gEnv->pCryPak->OpenPack("@products@", testGamePropertiesAssetPak));
AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, testAssetId);
AZ::u64 assetSize4 = assetInfo.m_sizeBytes;
EXPECT_EQ(assetSize4, assetSize1);
@@ -1,3 +1,3 @@
[General]
version=1
startScript="ImportActor -filename \"@assets@/foo.actor\"\nCreateActorInstance -actorID %LASTRESULT% -xPos 0.000000 -yPos 0.000000 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,0.00000000,0.00000000,1.00015891\nLoadMotionSet -filename \"@assets@/foo.motionset\"\nLoadAnimGraph -filename \"@assets@/foo.animgraph\"\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n"
startScript="ImportActor -filename \"@products@/foo.actor\"\nCreateActorInstance -actorID %LASTRESULT% -xPos 0.000000 -yPos 0.000000 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,0.00000000,0.00000000,1.00015891\nLoadMotionSet -filename \"@products@/foo.motionset\"\nLoadAnimGraph -filename \"@products@/foo.animgraph\"\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n"
@@ -2,7 +2,7 @@
<Textures>
<Texture Map="Diffuse" File="/engineassets/textures/hex.dds"/>
<Texture Map="Bumpmap" File="./engineassets/textures/hex_ddn.dds"/>
<Texture Map="Specular" File="@assets@/engineassets/textures/hex_spec.dds"/>
<Texture Map="Specular" File="@products@/engineassets/textures/hex_spec.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
+5 -5
View File
@@ -606,7 +606,7 @@ void EditorWindow::AddMenu_View()
[this]([[maybe_unused]] bool checked)
{
// Clear guides
AZStd::string canvasUndoXml = CanvasHelpers::BeginUndoableCanvasChange(GetCanvas());
AZStd::string canvasUndoXml = CanvasHelpers::BeginUndoableCanvasChange(GetCanvas());
EBUS_EVENT_ID(GetCanvas(), UiEditorCanvasBus, RemoveAllGuides);
CanvasHelpers::EndUndoableCanvasChange(this, "clear guides", canvasUndoXml);
});
@@ -724,7 +724,7 @@ void EditorWindow::AddMenu_View_LanguageSetting(QMenu* viewMenu)
// Iterate through the subdirectories of the localization folder. Each
// directory corresponds to a different language containing localization
// translations for that language.
AZStd::string fullLocPath(AZStd::string(gEnv->pFileIO->GetAlias("@assets@")) + "/" + AZStd::string(m_startupLocFolderName.toUtf8().constData()));
AZStd::string fullLocPath(AZStd::string(gEnv->pFileIO->GetAlias("@products@")) + "/" + AZStd::string(m_startupLocFolderName.toUtf8().constData()));
QDir locDir(fullLocPath.c_str());
locDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
locDir.setSorting(QDir::Name);
@@ -733,7 +733,7 @@ void EditorWindow::AddMenu_View_LanguageSetting(QMenu* viewMenu)
{
QString directoryName(subDirectory.fileName().toLower());
// The loc system expects XML assets stored in a language-specific
// The loc system expects XML assets stored in a language-specific
// folder with an "_xml" suffix in the name. Truncate the displayed
// name so the user just sees the language name (this isn't required
// though).
@@ -754,7 +754,7 @@ void EditorWindow::AddMenu_View_LanguageSetting(QMenu* viewMenu)
{
// First try to locate the directory by name, without the "_xml"
// suffix (in case it actually exists by this name).
QString fullLocPath(QString(gEnv->pFileIO->GetAlias("@assets@")) + "/" + m_startupLocFolderName + "/" + directoryName);
QString fullLocPath(QString(gEnv->pFileIO->GetAlias("@products@")) + "/" + m_startupLocFolderName + "/" + directoryName);
QDir locDir(fullLocPath);
// Try the directory with the expected suffix
@@ -780,7 +780,7 @@ void EditorWindow::AddMenu_View_LanguageSetting(QMenu* viewMenu)
"This used to be set to CSystem::OnLocalizationFolderCVarChanged but is now missing. "
"UI Editor language-switching features are no longer working.");
}
// Update the language setting; this will allow font families to
// load language-specific font assets
ICVar* languageCvar = gEnv->pConsole->GetCVar("g_language");
+3 -3
View File
@@ -138,7 +138,7 @@ void UiSliceManager::MakeSliceFromEntities(AzToolsFramework::EntityIdList& entit
// expand the list of entities to include all child entities
AzToolsFramework::EntityIdSet entitiesAndDescendants = GatherEntitiesAndAllDescendents(entities);
const AZStd::string slicesAssetsPath = "@devassets@/UI/Slices";
const AZStd::string slicesAssetsPath = "@projectroot@/UI/Slices";
if (!gEnv->pFileIO->Exists(slicesAssetsPath.c_str()))
{
@@ -991,13 +991,13 @@ AZStd::string UiSliceManager::MakeTemporaryFilePathForSave(const char* targetFil
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
AZ_Assert(fileIO, "File IO is not initialized.");
AZStd::string devAssetPath = fileIO->GetAlias("@devassets@");
AZStd::string devAssetPath = fileIO->GetAlias("@projectroot@");
AZStd::string userPath = fileIO->GetAlias("@user@");
AZStd::string tempPath = targetFilename;
EBUS_EVENT(AzFramework::ApplicationRequests::Bus, NormalizePath, devAssetPath);
EBUS_EVENT(AzFramework::ApplicationRequests::Bus, NormalizePath, userPath);
EBUS_EVENT(AzFramework::ApplicationRequests::Bus, NormalizePath, tempPath);
AzFramework::StringFunc::Replace(tempPath, "@devassets@", devAssetPath.c_str());
AzFramework::StringFunc::Replace(tempPath, "@projectroot@", devAssetPath.c_str());
AzFramework::StringFunc::Replace(tempPath, devAssetPath.c_str(), userPath.c_str());
tempPath.append(".slicetemp");
+6 -6
View File
@@ -67,7 +67,7 @@ namespace
// Check if extension needs to be fixed up
const AZStd::string canvasExtension("uicanvas");
bool validExtension = AzFramework::StringFunc::Path::IsExtension(assetPath.c_str(), canvasExtension.c_str(), true);
bool validExtension = AzFramework::StringFunc::Path::IsExtension(assetPath.c_str(), canvasExtension.c_str(), true);
if (!validExtension)
{
// Fix extension
@@ -79,7 +79,7 @@ namespace
// Normalize path
EBUS_EVENT(AzFramework::ApplicationRequests::Bus, NormalizePathKeepCase, assetPath);
// Check for any leading slashes as the specified path should be a relative path to the @assets@ alias.
// Check for any leading slashes as the specified path should be a relative path to the @products@ alias.
// This eliminates inconsistencies between lower level file opens on different platforms
int numCharsToErase = 0;
for (; numCharsToErase < assetPath.length(); ++numCharsToErase)
@@ -581,7 +581,7 @@ void UiCanvasManager::UpdateLoadedCanvases(float deltaTime)
// Update all the canvases loaded in game.
// It is unlikely this will call out to client code that could remove a canvas but we have no
// control over what custom components do so we increment the count that will defer all canvas deletion
// control over what custom components do so we increment the count that will defer all canvas deletion
m_recursionGuardCount++;
if (m_generateMousePositionInputEvent)
{
@@ -1087,7 +1087,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const
}
const char* enabledString = isCanvasEnabled ? "Y" : "N";
totalEnabled += isCanvasEnabled ? 1 : 0;
bool posEnabled = canvas->GetIsPositionalInputSupported();
const char* posEnabledString = posEnabled ? "Y" : "N";
totalPositionalInputs += posEnabled ? 1 : 0;
@@ -1178,7 +1178,7 @@ void UiCanvasManager::DebugDisplayDrawCallData() const
const AZ::Vector3 blue(0.3f,0.3f,1);
const AZ::Vector3 green(0.3f,1,0.3f);
const AZ::Vector3 yellow(0.7f,0.7f,0.2f);
// local function to write a line of text (with a background rect) and increment Y offset
AZStd::function<void(const char*, const AZ::Vector3&)> WriteLine = [&](const char* buffer, const AZ::Vector3& color)
{
@@ -1191,7 +1191,7 @@ void UiCanvasManager::DebugDisplayDrawCallData() const
draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 16, textOpacity, &textOptions);
yOffset += lineSpacing;
};
char buffer[200];
sprintf_s(buffer, "NN: %20s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s",
@@ -60,7 +60,7 @@ AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);
using namespace AZ;
using ::testing::NiceMock;
class LyShineSystemTestComponent
class LyShineSystemTestComponent
: public LyShine::LyShineSystemComponent
{
friend class LyShineEditorTest;
@@ -90,18 +90,18 @@ protected:
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
const AZStd::string engineRoot = AZ::Test::GetEngineRootPath();
AZ::IO::FileIOBase::GetInstance()->SetAlias("@engroot@", engineRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@engroot@", engineRoot.c_str());
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", assetRoot.c_str());
AZ::SerializeContext* context = nullptr;
ComponentApplicationBus::BroadcastResult(context, &ComponentApplicationBus::Events::GetSerializeContext);
@@ -127,21 +127,21 @@ namespace MessagePopup
switch (_buttons)
{
case EPopupButtons::EPopupButtons_NoButtons:
canvasEntityId = gEnv->pLyShine->LoadCanvas("@assets@/ui/canvases/defaultmessagepopup.uicanvas");
canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup.uicanvas");
break;
case EPopupButtons::EPopupButtons_Confirm:
canvasEntityId = gEnv->pLyShine->LoadCanvas("@assets@/ui/canvases/defaultmessagepopup_confirm.uicanvas");
canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_confirm.uicanvas");
isNavigationSupported = true;
break;
case EPopupButtons::EPopupButtons_YesNo:
canvasEntityId = gEnv->pLyShine->LoadCanvas("@assets@/ui/canvases/defaultmessagepopup_yesno.uicanvas");
canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_yesno.uicanvas");
isNavigationSupported = true;
break;
}
}
else if (_kind == EPopupKind_Toaster)
{
canvasEntityId = gEnv->pLyShine->LoadCanvas("@assets@/ui/canvases/toaster.uicanvas");
canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/toaster.uicanvas");
}
if (canvasEntityId.IsValid())
@@ -1,3 +1,3 @@
[General]
version=1
startScript="ImportActor -filename \"@assets@/characters/cowboy/actor/cowboy_01.actor\"\nCreateActorInstance -actorID %LASTRESULT% -xPos 0.000000 -yPos 0.000000 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,0.00000000,0.00000000,1.00000000\nLoadMotionSet -filename \"@assets@/Characters/Cowboy/AnimationEditorFiles/Cowboy.motionset\"\nLoadAnimGraph -filename \"@assets@/Characters/Cowboy/AnimationEditorFiles/Cowboy.animgraph\"\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n"
startScript="ImportActor -filename \"@products@/characters/cowboy/actor/cowboy_01.actor\"\nCreateActorInstance -actorID %LASTRESULT% -xPos 0.000000 -yPos 0.000000 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,0.00000000,0.00000000,1.00000000\nLoadMotionSet -filename \"@products@/Characters/Cowboy/AnimationEditorFiles/Cowboy.motionset\"\nLoadAnimGraph -filename \"@products@/Characters/Cowboy/AnimationEditorFiles/Cowboy.animgraph\"\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n"
@@ -202,9 +202,6 @@ namespace QtForPython
QtBootstrapParameters QtForPythonSystemComponent::GetQtBootstrapParameters() const
{
QtBootstrapParameters params;
char devroot[AZ_MAX_PATH_LEN];
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devroot@", devroot, AZ_MAX_PATH_LEN);
#if !defined(Q_OS_WIN)
#error Unsupported OS platform for this QtForPython gem
@@ -36,13 +36,12 @@ protected:
m_app.Start(AZ::ComponentApplication::Descriptor());
AZ::Debug::TraceMessageBus::Handler::BusConnect();
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
m_workingDirectory = m_app.GetExecutableFolder();
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", m_workingDirectory);
AZ::IO::FileIOBase::GetInstance()->SetAlias("@assets@", m_workingDirectory);
AZ::IO::FileIOBase::GetInstance()->SetAlias("@products@", m_workingDirectory);
}
void TearDown() override
@@ -78,7 +77,7 @@ protected:
}
void TestSuccessCase(const SceneAPI::Events::ExportProduct& exportProduct,
const AssetBuilderSDK::ProductPathDependency* expectedPathDependency = nullptr,
const AssetBuilderSDK::ProductPathDependency* expectedPathDependency = nullptr,
const AZ::Uuid* expectedProductDependency = nullptr)
{
AssetBuilderSDK::ProductPathDependencySet expectedPathDependencies;
@@ -86,13 +85,13 @@ protected:
{
expectedPathDependencies.emplace(*expectedPathDependency);
}
AZStd::vector<AZ::Uuid> expectedProductDependencies;
if (expectedProductDependency)
{
expectedProductDependencies.push_back(*expectedProductDependency);
}
TestSuccessCase(exportProduct, expectedPathDependencies, expectedProductDependencies);
}
@@ -121,7 +120,7 @@ TEST_F(SceneBuilderTests, SceneBuilderWorker_ExportProductDependencies_PathDepen
const char* absolutePathToFile = "/some/test/file.mtl";
#endif // AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS
AssetBuilderSDK::ProductPathDependency expectedPathDependency(absolutePathToFile, AssetBuilderSDK::ProductPathDependencyType::SourceFile);
SceneAPI::Events::ExportProduct product("testExportFile", AZ::Uuid::CreateRandom(), AZ::Data::AssetType::CreateNull(), u8(0), AZStd::nullopt);
product.m_legacyPathDependencies.push_back(absolutePathToFile);
TestSuccessCase(product, &expectedPathDependency);
@@ -133,7 +132,7 @@ TEST_F(SceneBuilderTests, SceneBuilderWorker_ExportProductDependencies_PathDepen
const char* relativeDependencyPathToFile = "some/test/file.mtl";
AssetBuilderSDK::ProductPathDependency expectedPathDependency(relativeDependencyPathToFile, AssetBuilderSDK::ProductPathDependencyType::ProductFile);
SceneAPI::Events::ExportProduct product("testExportFile", AZ::Uuid::CreateRandom(), AZ::Data::AssetType::CreateNull(), u8(0), AZStd::nullopt);
product.m_legacyPathDependencies.push_back(relativeDependencyPathToFile);
@@ -41,7 +41,7 @@ namespace ScriptCanvasEditor
azrtti_typeid<ScriptCanvasAsset>(),
"Script Canvas",
"Script Canvas Graph Asset",
"@devassets@/scriptcanvas",
"@projectroot@/scriptcanvas",
".scriptcanvas",
"Script Canvas",
"Untitled-%i",
@@ -9,27 +9,20 @@
#include "CommonSettingsConfigurations.h"
#include <AzCore/IO/FileIO.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
namespace ScriptCanvasEditor
{
AZStd::string GetEditingGameDataFolder()
{
const char* resultValue = nullptr;
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(resultValue, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAbsoluteDevGameFolderPath);
if (!resultValue)
AZ::IO::Path projectPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
if (AZ::IO::FileIOBase::GetInstance())
{
resultValue = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@");
}
settingsRegistry->Get(projectPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectPath);
}
if (!resultValue)
{
resultValue = ".";
}
return resultValue;
return projectPath.Native();
}
}
@@ -72,6 +72,7 @@
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzCore/Component/EntityUtils.h>
#include <AzCore/Serialization/IdUtils.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/Math/Color.h>
#include <AzCore/Math/Vector2.h>
#include <AzCore/Math/Vector3.h>
@@ -224,7 +225,7 @@ namespace ScriptCanvasEditor
}
}
} // anonymous namespace.
void Workspace::Save()
{
auto workspace = AZ::UserSettings::CreateFind<EditorSettings::EditorWorkspace>(AZ_CRC("ScriptCanvasEditorWindowState", 0x10c47d36), AZ::UserSettings::CT_LOCAL);
@@ -423,7 +424,7 @@ namespace ScriptCanvasEditor
, m_queueCloseRequest(false)
, m_hasQueuedClose(false)
, m_isInAutomation(false)
, m_allowAutoSave(true)
, m_allowAutoSave(true)
, m_systemTickActions(0)
, m_closeCurrentGraphAfterSave(false)
, m_styleManager(ScriptCanvasEditor::AssetEditorId, "ScriptCanvas/StyleSheet/graphcanvas_style.json")
@@ -432,7 +433,7 @@ namespace ScriptCanvasEditor
GraphCanvas::AssetEditorAutomationRequestBus::Handler::BusConnect(ScriptCanvasEditor::AssetEditorId);
AZStd::array<char, AZ::IO::MaxPathLength> unresolvedPath;
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@assets@/translation/scriptcanvas_en_us.qm", unresolvedPath.data(), unresolvedPath.size());
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@products@/translation/scriptcanvas_en_us.qm", unresolvedPath.data(), unresolvedPath.size());
QString translationFilePath(unresolvedPath.data());
if ( m_translator.load(QLocale::Language::English, translationFilePath) )
@@ -541,7 +542,7 @@ namespace ScriptCanvasEditor
m_editorToolbar->AddCustomAction(m_createFunctionOutput);
connect(m_createFunctionOutput, &QToolButton::clicked, this, &MainWindow::CreateFunctionOutput);
{
m_validateGraphToolButton = new QToolButton();
@@ -553,7 +554,7 @@ namespace ScriptCanvasEditor
m_editorToolbar->AddCustomAction(m_validateGraphToolButton);
connect(m_validateGraphToolButton, &QToolButton::clicked, this, &MainWindow::OnValidateCurrentGraph);
m_layout->addWidget(m_editorToolbar);
// Tab bar
@@ -578,7 +579,7 @@ namespace ScriptCanvasEditor
m_commandLine = new Widget::CommandLine(this);
m_commandLine->setBaseSize(QSize(size().width(), m_commandLine->size().height()));
m_commandLine->setObjectName("CommandLine");
m_commandLine->setObjectName("CommandLine");
m_layout->addWidget(m_commandLine);
m_layout->addWidget(m_emptyCanvas);
@@ -602,7 +603,7 @@ namespace ScriptCanvasEditor
// in sync with the order we display under tools for consistency.
{
const bool isInContextMenu = false;
Widget::ScriptCanvasNodePaletteConfig nodePaletteConfig(m_nodePaletteModel, m_scriptEventsAssetModel, isInContextMenu);
Widget::ScriptCanvasNodePaletteConfig nodePaletteConfig(m_nodePaletteModel, m_scriptEventsAssetModel, isInContextMenu);
m_nodePalette = aznew Widget::NodePaletteDockWidget(tr("Node Palette"), this, nodePaletteConfig);
m_nodePalette->setObjectName("NodePalette");
@@ -734,21 +735,23 @@ namespace ScriptCanvasEditor
message.append(QObject::tr("<br>%1 graph(s) that need manual corrections. You will be prompted to review them after you close this dialog.<br>").arg(assetsThatNeedManualInspection));
}
// Report
char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 };
AZStd::string outputFileName = AZStd::string::format("@devroot@/ScriptCanvasUpgradeReport.html");
AZ::IO::FileIOBase::GetInstance()->ResolvePath(outputFileName.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN);
AZStd::string urlToReport = AZStd::string::format("For more information see the <a href=\"%s\">Upgrade Report</a>.", resolvedBuffer);
auto settingsRegistry = AZ::SettingsRegistry::Get();
AZ::IO::Path outputFileName;
settingsRegistry->Get(outputFileName.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectLogPath);
outputFileName /= "ScriptCanvasUpgradeReport.html";
// Report
AZStd::string urlToReport = AZStd::string::format("For more information see the <a href=\"%s\">Upgrade Report</a>.", outputFileName.c_str());
message.append(QObject::tr("<br>%1").arg(urlToReport.c_str()));
// Backup
if (upgradeTool->HasBackup())
{
AZStd::string outputFileName2 = AZStd::string::format("@devroot@/ScriptCanvas_BACKUP");
AZ::IO::Path outputFileName2;
settingsRegistry->Get(outputFileName2.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectUserPath);
outputFileName2 /= "ScriptCanvas_BACKUP";
AZ::IO::FileIOBase::GetInstance()->ResolvePath(outputFileName2.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN);
AZStd::string backupPath = AZStd::string::format("<br>Open the <a href=\"%s\">Backup Folder</a>.", resolvedBuffer);
AZStd::string backupPath = AZStd::string::format("<br>Open the <a href=\"%s\">Backup Folder</a>.", outputFileName.c_str());
message.append(QObject::tr("%1").arg(backupPath.c_str()));
}
@@ -882,14 +885,14 @@ namespace ScriptCanvasEditor
connect(ui->action_ViewVariableManager, &QAction::triggered, this, &MainWindow::OnVariableManager);
connect(m_variableDockWidget, &QDockWidget::visibilityChanged, this, &MainWindow::OnViewVisibilityChanged);
connect(ui->action_ViewLogWindow, &QAction::triggered, this, &MainWindow::OnViewLogWindow);
connect(m_loggingWindow, &QDockWidget::visibilityChanged, this, &MainWindow::OnViewVisibilityChanged);
connect(ui->action_ViewDebugger, &QAction::triggered, this, &MainWindow::OnViewDebugger);
connect(ui->action_ViewCommandLine, &QAction::triggered, this, &MainWindow::OnViewCommandLine);
connect(ui->action_ViewLog, &QAction::triggered, this, &MainWindow::OnViewLog);
connect(ui->action_GraphValidation, &QAction::triggered, this, &MainWindow::OnViewGraphValidation);
connect(ui->action_Debugging, &QAction::triggered, this, &MainWindow::OnViewDebuggingWindow);
@@ -897,7 +900,7 @@ namespace ScriptCanvasEditor
connect(ui->action_NodeStatistics, &QAction::triggered, this, &MainWindow::OnViewStatisticsPanel);
connect(ui->action_PresetsEditor, &QAction::triggered, this, &MainWindow::OnViewPresetsEditor);
connect(ui->action_ViewRestoreDefaultLayout, &QAction::triggered, this, &MainWindow::OnRestoreDefaultLayout);
connect(ui->action_ViewRestoreDefaultLayout, &QAction::triggered, this, &MainWindow::OnRestoreDefaultLayout);
}
void MainWindow::SignalActiveSceneChanged(AZ::Data::AssetId assetId)
@@ -920,7 +923,7 @@ namespace ScriptCanvasEditor
// The paste action refreshes based on the scene's mimetype
RefreshPasteAction();
bool enabled = false;
if (graphId.IsValid())
@@ -1016,7 +1019,7 @@ namespace ScriptCanvasEditor
QString tabName = m_tabBar->tabText(tabCounter);
UnsavedChangesOptions shouldSaveResults = ShowSaveDialog(tabName);
if (shouldSaveResults == UnsavedChangesOptions::SAVE)
{
Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, AZ::Data::AssetId)
@@ -1041,7 +1044,7 @@ namespace ScriptCanvasEditor
{
m_processedClosedAssetIds.clear();
event->ignore();
return;
}
else if (shouldSaveResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING &&
@@ -1066,7 +1069,7 @@ namespace ScriptCanvasEditor
}
m_processedClosedAssetIds.clear();
event->accept();
}
@@ -1232,7 +1235,7 @@ namespace ScriptCanvasEditor
const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId);
if (fileState != Tracker::ScriptCanvasFileState::NEW)
{
AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED);
AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED);
}
}
}
@@ -1734,12 +1737,12 @@ namespace ScriptCanvasEditor
{
currentTarget.SetInvalid();
}
}
}
}
return retVal;
}
void MainWindow::OnFileNew()
{
MakeNewFile<ScriptCanvasAsset, ScriptCanvasAssetHandler>();
@@ -1756,7 +1759,7 @@ namespace ScriptCanvasEditor
m_tabBar->InsertGraphTab(tabIndex, assetId);
if (!IsTabOpen(assetId, outTabIndex))
{
{
AZ_Assert(false, AZStd::string::format("Unable to open new Script Canvas Asset with id %s in the Script Canvas Editor", AssetHelpers::AssetIdToString(assetId).c_str()).c_str());
return -1;
}
@@ -1854,7 +1857,7 @@ namespace ScriptCanvasEditor
}
PrepareAssetForSave(inMemoryAssetId);
AZStd::string suggestedFilename;
AZStd::string suggestedFileFilter;
GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter);
@@ -1881,7 +1884,7 @@ namespace ScriptCanvasEditor
AZStd::string assetRoot;
AZStd::array<char, AZ::IO::MaxPathLength> assetRootChar;
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devroot@", assetRootChar.data(), assetRootChar.size());
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size());
assetRoot = assetRootChar.data();
/* if (!AZ::StringFunc::StartsWith(filePath, assetRoot))
@@ -1906,7 +1909,7 @@ namespace ScriptCanvasEditor
if (isValidFileName)
{
AZStd::string internalStringFile = selectedFile.toUtf8().data();
AZStd::string internalStringFile = selectedFile.toUtf8().data();
if (!AssetHelpers::IsValidSourceFile(internalStringFile, GetActiveScriptCanvasId()))
{
@@ -1923,7 +1926,7 @@ namespace ScriptCanvasEditor
return true;
}
return false;
}
@@ -1965,7 +1968,7 @@ namespace ScriptCanvasEditor
saveTabIndex = m_tabBar->FindTab(previousFileAssetId);
}
}
AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName);
// Update the tab's assetId to the file asset Id (necessary when saving a new asset)
@@ -2047,7 +2050,7 @@ namespace ScriptCanvasEditor
}
m_closeCurrentGraphAfterSave = false;
EnableAssetView(memoryAsset);
UnblockCloseRequests();
@@ -2071,7 +2074,7 @@ namespace ScriptCanvasEditor
AZStd::invoke(onSave, saveSuccess, asset, previousAssetId);
}
};
AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Save, assetId, onSaveCallback);
UpdateSaveState();
@@ -2109,7 +2112,7 @@ namespace ScriptCanvasEditor
// Disable the current view if we are saving.
if (memoryAsset)
{
DisableAssetView(memoryAsset);
DisableAssetView(memoryAsset);
}
BlockCloseRequests();
@@ -2126,7 +2129,7 @@ namespace ScriptCanvasEditor
AZStd::string assetRoot;
{
AZStd::array<char, AZ::IO::MaxPathLength> assetRootChar;
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", assetRootChar.data(), assetRootChar.size());
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@projectroot@", assetRootChar.data(), assetRootChar.size());
assetRoot = assetRootChar.data();
}
@@ -2147,7 +2150,7 @@ namespace ScriptCanvasEditor
AssetRegistryRequestBus::BroadcastResult(fileFilters, &AssetRegistryRequests::GetAssetHandlerFileFilters);
QString filter;
AZStd::set<AZStd::string> filterSet;
auto aggregateFilters = fileFilters.values;
for (auto aggregateFilters2 : fileFilters.values)
@@ -2190,7 +2193,7 @@ namespace ScriptCanvasEditor
dialog.setFileMode(QFileDialog::ExistingFiles);
dialog.setNameFilters(nameFilters);
if (dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
m_filesToOpen = dialog.selectedFiles();
@@ -2206,7 +2209,7 @@ namespace ScriptCanvasEditor
ui->action_Paste->setShortcut(QKeySequence(QKeySequence::Paste));
ui->action_Delete->setShortcut(QKeySequence(QKeySequence::Delete));
connect(ui->menuEdit, &QMenu::aboutToShow, this, &MainWindow::OnEditMenuShow);
connect(ui->menuEdit, &QMenu::aboutToShow, this, &MainWindow::OnEditMenuShow);
// Edit Menu
connect(ui->action_Undo, &QAction::triggered, this, &MainWindow::TriggerUndo);
@@ -2215,8 +2218,8 @@ namespace ScriptCanvasEditor
connect(ui->action_Copy, &QAction::triggered, this, &MainWindow::OnEditCopy);
connect(ui->action_Paste, &QAction::triggered, this, &MainWindow::OnEditPaste);
connect(ui->action_Duplicate, &QAction::triggered, this, &MainWindow::OnEditDuplicate);
connect(ui->action_Delete, &QAction::triggered, this, &MainWindow::OnEditDelete);
connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &MainWindow::RefreshPasteAction);
connect(ui->action_Delete, &QAction::triggered, this, &MainWindow::OnEditDelete);
connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &MainWindow::RefreshPasteAction);
connect(ui->action_RemoveUnusedNodes, &QAction::triggered, this, &MainWindow::OnRemoveUnusedNodes);
connect(ui->action_RemoveUnusedVariables, &QAction::triggered, this, &MainWindow::OnRemoveUnusedVariables);
connect(ui->action_RemoveUnusedElements, &QAction::triggered, this, &MainWindow::OnRemoveUnusedElements);
@@ -2246,7 +2249,7 @@ namespace ScriptCanvasEditor
connect(ui->action_GotoEndOfChain, &QAction::triggered, this, &MainWindow::OnGotoEndOfChain);
connect(ui->action_GlobalPreferences, &QAction::triggered, [this]()
connect(ui->action_GlobalPreferences, &QAction::triggered, [this]()
{
ScriptCanvasEditor::SettingsDialog(ui->action_GlobalPreferences->text(), ScriptCanvas::ScriptCanvasId(), this).exec();
@@ -2372,7 +2375,7 @@ namespace ScriptCanvasEditor
{
AZ::EntityId graphCanvasGraphId = GetActiveGraphCanvasGraphId();
GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::SelectAllRelative, GraphCanvas::ConnectionType::CT_Input);
GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::SelectAllRelative, GraphCanvas::ConnectionType::CT_Input);
}
void MainWindow::OnSelectOutputs()
@@ -2635,8 +2638,8 @@ namespace ScriptCanvasEditor
{
ScriptCanvas::ScriptCanvasId scriptCanvasId;
AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId);
return scriptCanvasId;
}
return scriptCanvasId;
}
ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const
{
@@ -2849,7 +2852,7 @@ namespace ScriptCanvasEditor
AssetTrackerRequests::AssetList assets;
AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets);
for (auto asset : assets)
{
RemoveScriptCanvasAsset(asset->GetAsset().GetId());
@@ -2927,14 +2930,14 @@ namespace ScriptCanvasEditor
}
void MainWindow::SaveTab(int index)
{
{
QVariant tabdata = m_tabBar->tabData(index);
if (tabdata.isValid())
{
auto assetId = tabdata.value<AZ::Data::AssetId>();
SaveAssetImpl(assetId, nullptr);
}
}
void MainWindow::CloseAllTabs()
@@ -2955,7 +2958,7 @@ namespace ScriptCanvasEditor
m_isClosingTabs = true;
m_skipTabOnClose = assetId;
CloseNextTab();
}
}
}
void MainWindow::CopyPathToClipboard(int index)
@@ -3051,7 +3054,7 @@ namespace ScriptCanvasEditor
// The last tab has been removed.
SetActiveAsset({});
}
// Handling various close all events because the save is async need to deal with this in a bunch of different ways
// Always want to trigger this, even if we don't have any active tabs to avoid doubling the clean-up
// information
@@ -3069,7 +3072,7 @@ namespace ScriptCanvasEditor
for (const auto& slotId : outputDataSlotIds)
{
if (!IsInUndoRedo(graphCanvasGraphId) && !isPaste && CreateAzEventHandlerSlotMenuAction::FindBehaviorMethodWithAzEventReturn(graphCanvasGraphId, slotId))
{
CreateAzEventHandlerSlotMenuAction eventHandlerAction(this);
@@ -3195,7 +3198,7 @@ namespace ScriptCanvasEditor
m_minimap->hide();
}
*/
resizeDocks(
{ m_nodePalette, m_propertyGrid },
{ static_cast<int>(size().width() * 0.15f), static_cast<int>(size().width() * 0.2f) },
@@ -3204,7 +3207,7 @@ namespace ScriptCanvasEditor
resizeDocks({ m_nodePalette, m_minimap },
{ static_cast<int>(size().height() * 0.70f), static_cast<int>(size().height() * 0.30f) },
Qt::Vertical);
resizeDocks({ m_propertyGrid, m_variableDockWidget },
{ static_cast<int>(size().height() * 0.70f), static_cast<int>(size().height() * 0.30f) },
@@ -3229,7 +3232,7 @@ namespace ScriptCanvasEditor
AZ::EntityId graphCanvasGraphId;
EditorGraphRequestBus::EventResult(graphCanvasGraphId, scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId);
bool hasCopiableSelection = false;
bool hasSelection = false;
@@ -3268,7 +3271,7 @@ namespace ScriptCanvasEditor
ui->action_Duplicate->setEnabled(hasCopiableSelection);
// Delete will work for anything that is selectable
ui->action_Delete->setEnabled(hasSelection);
ui->action_Delete->setEnabled(hasSelection);
}
void MainWindow::OnViewNodePalette()
@@ -3470,7 +3473,7 @@ namespace ScriptCanvasEditor
if (ui->action_Debugging->isChecked() != m_loggingWindow->isVisible())
{
ui->action_Debugging->setChecked(m_loggingWindow->isVisible());
}
}
// Want these two elements to be mutually exclusive.
if (m_statusWidget->isVisible() == m_validationDockWidget->isVisible())
@@ -3624,7 +3627,7 @@ namespace ScriptCanvasEditor
if (m_isRestoringWorkspace)
{
m_isRestoringWorkspace = false;
if (m_queuedFocusOverride.IsValid())
{
SetActiveAsset(m_queuedFocusOverride);
@@ -3701,7 +3704,7 @@ namespace ScriptCanvasEditor
hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED
|| fileState == Tracker::ScriptCanvasFileState::NEW
|| fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED);
AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeAssetId);
}
@@ -4084,7 +4087,7 @@ namespace ScriptCanvasEditor
if (action == nullptr)
{
GraphCanvas::GraphCanvasMimeEvent* mimeEvent = m_sceneContextMenu->GetNodePalette()->GetContextMenuEvent();
NodeIdPair finalNode = ProcessCreateNodeMimeEvent(mimeEvent, graphCanvasGraphId, AZ::Vector2(aznumeric_cast<float>(scenePoint.x()), aznumeric_cast<float>(scenePoint.y())));
GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::ClearSelection);
@@ -4436,7 +4439,7 @@ namespace ScriptCanvasEditor
targetLayer = (*selectedEntityIdIter);
selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter);
selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter);
}
else
{
@@ -4456,7 +4459,7 @@ namespace ScriptCanvasEditor
AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer);
}
}
for (const AZ::EntityId& entityId : selectedEntityIds)
{
AssignGraphToEntityImpl(entityId);
@@ -4515,7 +4518,7 @@ namespace ScriptCanvasEditor
{
usableRequestBus = firstRequestBus;
}
if (usableRequestBus == nullptr)
{
AzToolsFramework::EntityCompositionRequestBus::Broadcast(&EntityCompositionRequests::AddComponentsToEntities, AzToolsFramework::EntityIdList{ entityId }
@@ -4681,7 +4684,7 @@ namespace ScriptCanvasEditor
}
bool MainWindow::IsNodeNudgingEnabled() const
{
{
if (m_userSettings)
{
return m_userSettings->m_allowNodeNudging;
@@ -4720,7 +4723,7 @@ namespace ScriptCanvasEditor
return 0.03f;
}
float MainWindow::GetShakeDeadZonePercent() const
float MainWindow::GetShakeDeadZonePercent() const
{
if (m_userSettings)
{
@@ -4730,7 +4733,7 @@ namespace ScriptCanvasEditor
return 0.01f;
}
float MainWindow::GetShakeStraightnessPercent() const
float MainWindow::GetShakeStraightnessPercent() const
{
if (m_userSettings)
{
@@ -673,7 +673,7 @@ namespace ScriptCanvasEditor
AZStd::array<char, AZ::IO::MaxPathLength> assetRootArray;
if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(ScriptCanvas::AssetDescription::GetSuggestedSavePath<GraphAssetType>(), assetRootArray.data(), assetRootArray.size()))
{
AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @devassets@ path");
AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path");
}
AZStd::string assetPath;
@@ -13,7 +13,9 @@
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Component/TickBus.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/IO/SystemFile.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsProvider.h>
#include <AzFramework/Asset/AssetSystemBus.h>
@@ -169,10 +171,11 @@ namespace ScriptCanvasEditor
QDateTime theTime = QDateTime::currentDateTime();
QString subFolder = theTime.toString("yyyy-MM-dd [HH.mm.ss]");
m_backupPath = AZStd::string::format("@devroot@/ScriptCanvas_BACKUP/%s", subFolder.toUtf8().data());
char backupPathCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(m_backupPath.c_str(), backupPathCStr, AZ_MAX_PATH_LEN);
m_backupPath = backupPathCStr;
auto settingsRegistry = AZ::SettingsRegistry::Get();
m_backupPath.clear();
settingsRegistry->Get(m_backupPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectUserPath);
m_backupPath = m_backupPath / "ScriptCanvas_BACKUP" / subFolder.toUtf8().data();
if (!AZ::IO::FileIOBase::GetInstance()->Exists(m_backupPath.c_str()))
{
@@ -489,56 +492,25 @@ namespace ScriptCanvasEditor
void UpgradeTool::BackupAsset(const AZ::Data::AssetInfo& assetInfo)
{
AZStd::string devRoot = "@devroot@";
AZStd::string devAssets = "@devassets@";
char devRootCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(devRoot.c_str(), devRootCStr, AZ_MAX_PATH_LEN);
char devAssetsCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(devAssets.c_str(), devAssetsCStr, AZ_MAX_PATH_LEN);
AZStd::string relativePath = devAssetsCStr;
AzFramework::StringFunc::Replace(relativePath, devRootCStr, "");
if (relativePath.starts_with("/"))
{
relativePath = relativePath.substr(1, relativePath.size() - 1);
}
AZStd::string sourceFilePath;
AZ::IO::FixedMaxPath sourceFilePath;
// Using this to get the watch folder
AZStd::string watchFolder;
AZ::Data::AssetInfo assetInfo2;
AZ::Data::AssetInfo sourceFileAssetInfo;
bool sourceInfoFound{};
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, assetInfo.m_relativePath.c_str(), assetInfo2, watchFolder);
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound,
&AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath,
assetInfo.m_relativePath.c_str(), sourceFileAssetInfo, watchFolder);
if (sourceInfoFound)
{
AZStd::string assetPath;
AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), assetPath);
sourceFilePath = assetPath;
sourceFilePath = AZ::IO::FixedMaxPath(AZStd::string_view(watchFolder)) / sourceFileAssetInfo.m_relativePath;
}
devRoot = devRootCStr;
AzFramework::StringFunc::Path::Normalize(devRoot);
relativePath = sourceFilePath;
AzFramework::StringFunc::Replace(relativePath, devRoot.c_str(), "");
if (relativePath.starts_with("/"))
{
relativePath = relativePath.substr(1, relativePath.size() - 1);
}
AZStd::string targetFilePath;
AzFramework::StringFunc::Path::Join(m_backupPath.c_str(), relativePath.c_str(), targetFilePath);
const auto targetFilePath = m_backupPath / sourceFileAssetInfo.m_relativePath;
if (AZ::IO::FileIOBase::GetInstance()->Copy(sourceFilePath.c_str(), targetFilePath.c_str()) != AZ::IO::ResultCode::Error)
{
AZStd::string filename;
AzFramework::StringFunc::Path::GetFileName(sourceFilePath.c_str(), filename);
AZ_TracePrintf("Script Canvas", "Backup: %s -> %s\n", filename.c_str(), targetFilePath.c_str());
AZ_TracePrintf("Script Canvas", "Backup: %s -> %s\n", sourceFilePath.c_str(), targetFilePath.c_str());
}
else
{
@@ -583,7 +555,7 @@ namespace ScriptCanvasEditor
void UpgradeTool::SaveLog()
{
AZStd::string outputFileName = AZStd::string::format("@devroot@/ScriptCanvasUpgradeReport.html");
AZStd::string outputFileName = AZStd::string::format("@log@/ScriptCanvasUpgradeReport.html");
char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(outputFileName.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN);
@@ -27,6 +27,7 @@ AZ_POP_DISABLE_WARNING
#include <ISystem.h>
#include <IConsole.h>
#include <AzCore/Debug/TraceMessageBus.h>
#include <AzCore/IO/Path/Path.h>
#endif
class QPushButton;
@@ -135,7 +136,7 @@ namespace ScriptCanvasEditor
AZ::Entity* m_scriptCanvasEntity = nullptr;
AZStd::string m_backupPath;
AZ::IO::Path m_backupPath;
void FinalizeUpgrade();
void DisconnectBuses();
@@ -19,6 +19,7 @@
#include <AzCore/Component/TickBus.h>
#include <AzCore/IO/FileIOEventBus.h>
#include <AzCore/IO/SystemFile.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsProvider.h>
#include <AzFramework/Asset/AssetSystemBus.h>
#include <AzFramework/IO/FileOperations.h>
@@ -301,51 +302,37 @@ namespace ScriptCanvasEditor
return "";
}
auto fileIoBase = AZ::IO::FileIOBase::GetInstance();
auto settingsRegistry = AZ::SettingsRegistry::Get();
QDateTime theTime = QDateTime::currentDateTime();
QString subFolder = theTime.toString("yyyy-MM-dd [HH.mm.ss]");
AZStd::string backupPath = AZStd::string::format("@devroot@/ScriptCanvas_BACKUP/%s", subFolder.toUtf8().data());
char backupPathCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(backupPath.c_str(), backupPathCStr, AZ_MAX_PATH_LEN);
backupPath = backupPathCStr;
AZ::IO::FixedMaxPath projectUserPath;
settingsRegistry->Get(projectUserPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectUserPath);
if (!AZ::IO::FileIOBase::GetInstance()->Exists(backupPath.c_str()))
AZ::IO::FixedMaxPath backupPath = projectUserPath / "ScriptCanvas_BACKUP" / subFolder.toUtf8().data();
if (!fileIoBase->Exists(backupPath.c_str()))
{
if (AZ::IO::FileIOBase::GetInstance()->CreatePath(backupPath.c_str()) != AZ::IO::ResultCode::Success)
if (fileIoBase->CreatePath(backupPath.c_str()) != AZ::IO::ResultCode::Success)
{
AZ_Error(ScriptCanvas::k_VersionExplorerWindow.data(), false, "Failed to create backup folder %s", backupPath.c_str());
return "Failed to create backup folder";
}
}
AZStd::string devRoot = "@devroot@";
AZStd::string devAssets = "@devassets@";
char devRootCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(devRoot.c_str(), devRootCStr, AZ_MAX_PATH_LEN);
char devAssetsCStr[AZ_MAX_PATH_LEN] = { 0 };
AZ::IO::FileIOBase::GetInstance()->ResolvePath(devAssets.c_str(), devAssetsCStr, AZ_MAX_PATH_LEN);
AZStd::string relativePath = devAssetsCStr;
AzFramework::StringFunc::Replace(relativePath, devRootCStr, "");
if (relativePath.starts_with("/"))
{
relativePath = relativePath.substr(1, relativePath.size() - 1);
}
AZStd::string sourceFilePath;
AZStd::string watchFolder;
AZ::Data::AssetInfo assetInfo;
AZ::IO::FixedMaxPath sourceFilePath;
bool sourceInfoFound{};
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, asset.GetHint().c_str(), assetInfo, watchFolder);
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound,
&AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath,
asset.GetHint().c_str(), assetInfo, watchFolder);
if (sourceInfoFound)
{
AZStd::string assetPath;
AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), assetPath);
sourceFilePath = assetPath;
sourceFilePath = AZ::IO::FixedMaxPath(AZStd::string_view(watchFolder)) / assetInfo.m_relativePath;
}
else
{
@@ -353,23 +340,9 @@ namespace ScriptCanvasEditor
return "Failed to find source file";
}
devRoot = devRootCStr;
AzFramework::StringFunc::Path::Normalize(devRoot);
const AZ::IO::FixedMaxPath targetFilePath = backupPath / assetInfo.m_relativePath;
relativePath = sourceFilePath;
AzFramework::StringFunc::Replace(relativePath, devRoot.c_str(), "");
if (relativePath.starts_with("/"))
{
relativePath = relativePath.substr(1, relativePath.size() - 1);
}
AzFramework::StringFunc::Path::Normalize(relativePath);
AzFramework::StringFunc::Path::Normalize(backupPath);
AZStd::string targetFilePath = backupPath;
targetFilePath += relativePath;
if (AZ::IO::FileIOBase::GetInstance()->Copy(sourceFilePath.c_str(), targetFilePath.c_str()) != AZ::IO::ResultCode::Success)
if (fileIoBase->Copy(sourceFilePath.c_str(), targetFilePath.c_str()) != AZ::IO::ResultCode::Success)
{
AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false, "VersionExplorer::BackupGraph: Error creating backup: %s ---> %s\n", sourceFilePath.c_str(), targetFilePath.c_str());
return "Failed to copy source file to backup location";
@@ -602,7 +575,7 @@ namespace ScriptCanvasEditor
});
streamer->QueueRequest(flushRequest);
}
}
}
}
void VersionExplorer::GraphUpgradeComplete
@@ -816,7 +789,7 @@ namespace ScriptCanvasEditor
}
char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 };
AZStd::string path = AZStd::string::format("@devroot@/%s", asset.GetHint().c_str());
AZStd::string path = AZStd::string::format("@engroot@/%s", asset.GetHint().c_str());
AZ::IO::FileIOBase::GetInstance()->ResolvePath(path.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN);
AZ::StringFunc::Path::GetFullPath(resolvedBuffer, path);
AZ::StringFunc::Path::Normalize(path);
@@ -873,7 +846,7 @@ namespace ScriptCanvasEditor
m_state = ProcessState::Upgrade;
AZ::SystemTickBus::Handler::BusConnect();
}
}
}
}
@@ -883,7 +856,7 @@ namespace ScriptCanvasEditor
m_inProgress = false;
m_ui->progressBar->setValue(aznumeric_cast<int>(m_currentAssetRowIndex));
m_ui->scanButton->setEnabled(true);
m_inspectingAsset = m_assetsToInspect.erase(m_inspectingAsset);
FlushLogs();
@@ -85,7 +85,7 @@ namespace ScriptCanvas
const char* ExecutionLogAsset::GetDefaultDirectoryRoot()
{
return AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@");
return AZ::IO::FileIOBase::GetInstance()->GetAlias("@engroot@");
}
ExecutionLogAsset::ExecutionLogAsset(const AZ::Data::AssetId& assetId, AZ::Data::AssetData::AssetStatus status)
@@ -36,7 +36,7 @@ namespace ScriptCanvas
azrtti_typeid<RuntimeAsset>(),
"Script Canvas Runtime",
"Script Canvas Runtime Graph",
"@devassets@/scriptcanvas",
"@projectroot@/scriptcanvas",
".scriptcanvas_compiled",
"Script Canvas Runtime",
"Untitled-%i",
@@ -177,7 +177,7 @@ namespace ScriptCanvas
azrtti_typeid<SubgraphInterfaceAsset>(),
"Script Canvas Function Interface",
"Script Canvas Function Interface",
"@devassets@/scriptcanvas",
"@projectroot@/scriptcanvas",
".scriptcanvas_fn_compiled",
"Script Canvas Function Interface",
"Untitled-Function-%i",
@@ -23,6 +23,7 @@
#include <AzCore/Memory/Memory.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/std/numeric.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
@@ -129,7 +130,7 @@ namespace WhiteBox
AzToolsFramework::EditorPythonRunnerRequestBus::Broadcast(
&AzToolsFramework::EditorPythonRunnerRequestBus::Events::ExecuteByFilenameWithArgs,
"@devroot@/Gems/WhiteBox/Editor/Scripts/default_shapes.py", scriptArgs);
"@engroot@/Gems/WhiteBox/Editor/Scripts/default_shapes.py", scriptArgs);
EditorWhiteBoxComponentNotificationBus::Event(
AZ::EntityComponentIdPair(GetEntityId(), GetId()),
@@ -499,13 +500,13 @@ namespace WhiteBox
static AZStd::string WhiteBoxPathAtProjectRoot(const AZStd::string_view name, const AZStd::string_view extension)
{
const char* projectFolder = nullptr;
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(
projectFolder, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAbsoluteDevGameFolderPath);
return AZStd::string::format(
"%s\\%.*s_whitebox.%.*s", projectFolder, aznumeric_cast<int>(name.size()), name.data(),
aznumeric_cast<int>(extension.size()), extension.data());
AZ::IO::Path whiteBoxPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Get(whiteBoxPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectPath);
}
whiteBoxPath /= AZ::IO::FixedMaxPathString::format("%.*s.%.*s", AZ_STRING_ARG(name), AZ_STRING_ARG(extension));
return whiteBoxPath.Native();
}
void EditorWhiteBoxComponent::ExportToFile()