* Skipping GraphUpdate test due to LC node issue in Debug configuration
Signed-off-by: jckand-amzn <jckand@amazon.com>
* Reverting test type for GraphUpdates test to EditorSharedTest
Signed-off-by: jckand-amzn <jckand@amazon.com>
* Updating xfail reason for GraphUpdates test with GitHub issue link
Signed-off-by: jckand-amzn <jckand@amazon.com>
* Initial support for importing Json files within other Json files
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add some test cases for testing/iterating on the Json import work. Fix MacOS AzTestRunner module loading bug.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* The import resolver can take the allocator as a parameter to Load/StoreImports() instead of storing a copy.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Fix assert
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Some rework of the JsonImport feature. Base test cases pass. More complex test cases need to be added.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add test case for testing nested imports.
2. Initialize rapidjson value to fix assert.
3. Fix bug found in merge patch creation.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Update the Resolver class member functions to return proper result codes.
2. Add the wrapper functions for resolving/restoring imports to the JsonSerialization class.
3. Add new test case.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add test cases for import + patches. Fix bug found when patching import. Rename test cases.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add ApplyPatch() function to BaseJsonImporter.
2. Move patch logic out of ResolveImport() and into ApplyPatch()
3. Get rid of the custom RestoreImport implementation in the tests since it was the same as the base version.
4. Add test case for patching nested imports.
5. Update merge patch outcome reporting logic to work for nested object patches.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add a CreatePatch() function to BaseJsonImporter to match the ApplyPatch() function.
2. Reorganize some responsibilities between RestoreImports(), RestoreImport() and CreatePatch() to make ResolveImports() and RestoreImports() more symmetrical.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Combine result code in code path where we add empty object to path
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add test case for inserting a new import into an existing object.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Use == instead of Compare() for comparing file paths.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Address some PR feedback.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Address additional PR feedback
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add missing includes to fix non-unity build
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Fix build error. Address additional feedback.
Signed-off-by: amzn-sj <srikkant@amazon.com>
`LaunchProcess()` on Linux works by calling `fork` then `execvpe`. `fork`
is used to copy a running process, generating a new child process. The new
child starts running from the location where the parent was running, from
whatever thread from the parent called `fork`. The child process only gets
one thread, however. If a different thread in the parent process had locked
a mutex, that mutex is also locked in the child process. Since that
separate thread is not present in the child, the mutex remains locked in
the child, with no way to unlock it. So it is important that as little work
as possible happens between the call to `fork` and to `execvpe`.
Previously, this code was trying to report an error that may have occurred
from calling `execvpe`. It was doing that by calling `AZ_TracePrintf`. That
function does lots of things, including trying to make an EBus call, which
looks up a variable in the `AZ::Environment` instance, which has a global
mutex. If there was some other thread that had that mutex locked when the
`fork` call was made, the subprocess would deadlock, and the parent process
would also deadlock waiting for the child to finish.
This solves that issue by removing the call to `AZ_TracePrintf` from the
subprocess code path. Instead, the parent process sets up a pipe for the
child process to write to in case the call to `execvpe` fails (the
self-pipe trick). The parent then reads from that pipe. If it reads no
data, `execvpe` worked and there's no error. If it does read data, the data
to be read is the errno from the failed `execvpe` call made by the child.
The parent can then use `strerror()` to report the error.
Fixes#4702.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Fixed create-project/create-gem to use relative paths directly
It was previously making relative paths, relative to the default_projects_folder and default_gems_folders
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Removed uppercase of "Templates" param in get_registered call.
That method looks up the restricted template directory location based on the lowercase key of "templates"
Updated argparse doc to fix typos or clarify which directories a path is relative to.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Also improved the MaterialAssetTests UpgradeMaterialAsset() to focus on testing the inputs and outputs of the class rather than the private internal data.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Also rearranged some logic to simplify the code that loops over rename actions, avoiding making unnecessary additional maps.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
- Added MaterialSourceData::ApplyVersionUpdates() for updating the properties. This should be called by tools after loading the MaterialSourceData. (But can be omitted if a tool wants to read the data exactly as it appears in the .material file).
- Updated MaterialTypeSourceData::FindProperty to support applying version update renames, including a ApplyPropertyRenames utility function, which are necessary for MaterialSourceData to be able to find the necessary property definitons while loading.
- Added a new context struct to JsonMaterialPropertyValueSerializer for passing down the material type version number, to help with applying property renames.
- Renamed the .material file format "propertyLayoutVersion" to "materialTypeVersion" which is more accurate. This shouldn't hurt existing data as this field wasn't actually used for anything before.
- Updated Material Editor to again store the material type version number in .material files.
MaterialSourceDataTests updates...
- Updated to include both a .materialtype file and a MaterialTypeAsset for the test material type. Both are used by the MaterialTypeSourceData class.
- The default test material type now includes some version update steps; these are only used for version update tests and won't impact the other test functions.
- Updated the path for storing temp files to disk, to just be in a "temp" folder in the exe path. (Originally they were saved to the gem folder near MaterialSourceDataTests.cpp, but at some point someone changed it to be under the exe folder, so there's no reason to use the full gem path anymore).
MaterialTypeSourceDataTests updates...
- Moved some code that was accidentally added to LoadAllFieldsUsingOldFormat but should have been in LoadAndStoreJson_AllFields.
- Added test cases for unsupported version update operations
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
- Prevent P4 thread to run if we cannot detect the P4 command to begin with
- Add a trait to disable calling the parent ComponentApplication::Destroy(), instead calling _exit() to skip the module unloading on exit
Signed-off-by: Steve Pham <spham@amazon.com>
* Initialize the PrefabFocusHandler on context reset, to also cover the case of a new level being created on the welcome screen.
Relax checks/restrictions on refreshes to cover cases where an instance is reused by the Prefab EOS.
Refresh the breadcrumbs when a container is renamed and when a change is propagated to the instances to ensure the correct names are displayed.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Rename m_isInitialized to m_initialized in PrefabFocusHandler
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Use find_if to detect when a container entity in the focus path has been renamed.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Renaming and commenting variables in PrefabFocusHandler.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Undo minor naming change
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Replace lazy initialization and have the UI side initialize the Editor calls in PrefabFocusHandler.
This should prevent issues with focus mode trying to access these interfaces in non-editor applications.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add an error message to AP when bad project path
Produce a log error or a dialog box error when the project path for AP
does not have a project.json and is invalid.
Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
* Fix a failing unit test - AssetProcessorMessages
Adding a check for 'project.json' caused BeforeRun() in a test fixture
to fail. Teardown of the fixture was also broken if the test failed to
fully startup the application manager, so added null checks there.
Added an assert to the fixture's Setup to check the status of BeforeRun().
Added additional settings registry setup to the fixture to make sure the
project path and branch token are configured before BeforeRun() is
called.
Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
old vs. new defaults:
%USERHOME%/.o3de/Projects-> %USERHOME%/O3DE/Projects
%USERHOME%/.o3de/Gems-> %USERHOME%/O3DE/Gems
%USERHOME%/.o3de/Templates-> %USERHOME%/O3DE/Templates
Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com>
Move the existing Qt Toast Notification QWidgets, EBuses and logic from the GraphCanvas gem into AzQtComponents and AzToolsFramework so they can be re-used.
Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com>
* {lyn7065} adding ProcPrefab Prefab::Tempate flag method
Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com>
* updated based on comments
Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com>
* moved validation logic to IsValid()
Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com>
* added more guards around the source string
Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com>